API / Minn\Cli / UserCommand

UserCommand final class

Minn\Cli\UserCommand · public/minn/src/Minn/Cli/UserCommand.php · 180 lines

Users: the list and get views, and the one-time login link. The list and get verbs take WP-CLI's bundled synopsis (Commands); a list the engine does not answer itself (query arguments, users without a role, fields beyond the record's own) goes back to the bundled command.

Used by 1

Constants and properties

privateFIELDS = array ( 0 => 'ID', 1 => 'user_login', 2 => 'display_name', 3 => 'user_email', 4 => 'user_registered', 5 => 'roles', )
privateLIST_ARGS = array ( 0 => 'role', 1 => 'field', 2 => 'fields', 3 => 'format', )

What the engine's own list reads: the role filter and the output arguments.

Public

methodlist(array $args, array $assocArgs): void#

Lists users.

## OPTIONS

[--role=<role>] : Only display users with a certain role.

[--<field>=<value>] : Control output by one or more arguments of the user query.

[--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 ---

methodget(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 ---

methodlogin(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.

Internals 3

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatefind(string $identifier): ?Minn\Content\UserRecord#

A user by the identifier WP-CLI's user fetcher takes: a number is an id (warned about when a login is the same number), an address an email or else a login (logins can be addresses), anything else a login; WP_CLI_FORCE_USER_LOGIN reads every identifier as a login.

privateownList(array $assocArgs): bool#

Whether the engine answers this list itself: only a role (not "none") and the record's own fields asked for.

privateitem(Minn\Content\UserRecord|array $row, array $roles, string $glue): array#
$roleslist<string>