wp-cli / entity-command

Manage WordPress comments, menus, options, posts, sites, terms, and users.
MIT License
100 stars 90 forks source link

Accept User instead of user ID only for reassign in user delete command #488

Closed ernilambar closed 7 months ago

ernilambar commented 7 months ago

Feature Request

Describe your use case and the problem you are facing

Currently only User ID is accepted for --reassign in user delete command.

Describe the solution you'd like

Accept user login, user ID or user email.

danielbachhuber commented 7 months ago

@ernilambar Can you share a bit more context for this request? I'm a bit hesitant about what you've proposed because:

ernilambar commented 7 months ago

Please elaborate if I am not getting something but I dont think it would be breaking change as using ID are reassign value will continue to work like now. Along with ID we will accept login and email address as value like we do in other user commands. Under the hood, ID will be the actual value like WP core accepts. We treat User ID, User Login and User Email as unique user identifier. So I think it would be good improvement to make those uniform in our all commands.

danielbachhuber commented 7 months ago

@ernilambar The breaking change is that login and email would start being accepted, when they aren't currently accepted.

I think it's fine to make the change when it's the primary argument for the command. It's a bug that it was inconsistent in the first place. I don't think we should change these secondary arguments, though.