entity-command icon indicating copy to clipboard operation
entity-command copied to clipboard

wp user create ignores --nickname

Open Hlsgs opened this issue 6 years ago • 5 comments

wp user create ignores --nickname and always uses the username instead

Hlsgs avatar Nov 06 '19 10:11 Hlsgs

It looks like this affects other fields too, such as --user_nicename and --user_url. See #301 .

johnbillion avatar Aug 10 '20 10:08 johnbillion

Weirdly enough, the nickname is only available when you retrieve users via get_users(), and not when you retrieve them via get_user_by()... See https://github.com/wp-cli/wp-cli/pull/5600

schlessera avatar Jan 13 '22 05:01 schlessera

Confirming still present in wp cli v2.6.0

Hlsgs avatar Jan 26 '22 12:01 Hlsgs

@Hlsgs Yes, indeed. I did some work in solving this, but it turns around it is mostly a bug in get_users(). I then tried to use WP_User_Query across the board for all WP-CLI user queries, but that just turned up with different bugs of its own. This needs more careful investigation in how best to solve.

schlessera avatar Jan 26 '22 15:01 schlessera

@Hlsgs Yes, indeed. I did some work in solving this, but it turns around it is mostly a bug in get_users(). I then tried to use WP_User_Query across the board for all WP-CLI user queries, but that just turned up with different bugs of its own. This needs more careful investigation in how best to solve.

Got it! Thank you for the lowdown.

Hlsgs avatar Jan 26 '22 17:01 Hlsgs