UserCommand final class
Minn\Cli\UserCommand · public/minn/src/Minn/Cli/UserCommand.php · 367 lines
Users: the list and get views, and the one-time login link.
Constants and properties
| private | FIELDS = array ( 0 => 'ID', 1 => 'user_login', 2 => 'display_name', 3 => 'user_email', 4 => 'user_registered', 5 => 'roles', ) |
Public
| method | list(array $args, array $assocArgs): void# | Lists users. ## OPTIONS [--role=<role>] : Only display users with a certain role. [--field=<field>] : Prints the value of a single field for each user. [--fields=<fields>] : Limit the output to specific object fields. [--format=<format>] : Render output in a particular format. --- default: table options: - table - csv - ids - json - count - yaml --- |
| method | get(array $args, array $assocArgs): void# | Gets details about a user. ## OPTIONS <user> : User ID, user email, or user login. [--field=<field>] : Instead of returning the whole user, returns the value of a single field. [--fields=<fields>] : Get a specific subset of the user's fields. [--format=<format>] : Render output in a particular format. --- default: table options: - table - csv - json - yaml --- |
| method | login(array $args, array $assocArgs): void# | Prints a one-time login link for a user. The link signs the user in at wp-login.php once, within fifteen minutes, and then expires (the contract of the captaincore helper). ## OPTIONS <user> : User ID, user email, or user login. |
| method | create(array $args, array $assocArgs): void# | Creates a new user. ## OPTIONS <user-login> : The login of the user to create. <user-email> : The email address of the user to create. [--role=<role>] : The role of the user to create. Default: the site's default role. [--user_pass=<password>] : The user password. Default: randomly generated. [--display_name=<name>] : The display name. [--user_nicename=<nice_name>] : A URL-friendly name. Default: the login. [--user_url=<url>] : The user's URL. [--nickname=<nickname>] : The nickname. Default: the login. [--first_name=<first_name>] : The first name. [--last_name=<last_name>] : The last name. [--description=<description>] : A description. [--send-email] : Send the new user a password-reset email. [--porcelain] : Output just the new user id. |
| method | update(array $args, array $assocArgs): void# | Updates an existing user. ## OPTIONS <user> : User ID, email, or login. [--user_pass=<password>] : A new password. [--user_email=<email>] : A new email. [--display_name=<name>] : A new display name. [--first_name=<first_name>] : A new first name. [--last_name=<last_name>] : A new last name. [--role=<role>] : A new role. |
| method | delete(array $args, array $assocArgs): void# | Deletes a user. ## OPTIONS <user> : User ID, email, or login. [--reassign=<id>] : User ID to reassign posts to. [--yes] : Answer yes to the confirmation. |
Internals 3
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
Nothing matches.