PHP Class User_Session_Command, wp-cli

## EXAMPLES # List a user's sessions. $ wp user session list [email protected] --format=csv login_time,expiration_time,ip,ua "2016-01-01 12:34:56","2016-02-01 12:34:56",127.0.0.1,"Mozilla/5.0..." # Destroy the most recent session of the given user. $ wp user session destroy admin Success: Destroyed session. 3 sessions remaining.
Inheritance: extends WP_CLI_Command
Exibir arquivo Open project: wp-cli/wp-cli

Public Methods

Method Description
__construct ( )
destroy ( $args, $assoc_args ) Destroy a session for the given user.
list_ ( $args, $assoc_args ) List sessions for the given user.

Protected Methods

Method Description
destroy_session ( WP_Session_Tokens $manager, $token )
get_all_sessions ( WP_Session_Tokens $manager )

Private Methods

Method Description
get_formatter ( &$assoc_args )

Method Details

__construct() public method

public __construct ( )

destroy() public method

## OPTIONS : User ID, user email, or user login. [] : The token of the session to destroy. Defaults to the most recently created session. [--all] : Destroy all of the user's sessions. ## EXAMPLES # Destroy the most recent session of the given user. $ wp user session destroy admin Success: Destroyed session. 3 sessions remaining. # Destroy a specific session of the given user. $ wp user session destroy admin e073ad8540a9c2... Success: Destroyed session. 2 sessions remaining. # Destroy all the sessions of the given user. $ wp user session destroy admin --all Success: Destroyed all sessions. # Destroy all sessions for all users. $ wp user list --field=ID | xargs wp user session destroy --all Success: Destroyed all sessions. Success: Destroyed all sessions.
public destroy ( $args, $assoc_args )

destroy_session() protected method

protected destroy_session ( WP_Session_Tokens $manager, $token )
$manager WP_Session_Tokens

get_all_sessions() protected method

protected get_all_sessions ( WP_Session_Tokens $manager )
$manager WP_Session_Tokens

list_() public method

## OPTIONS : User ID, user email, or user login. [--fields=] : Limit the output to specific fields. [--format=] : Render output in a particular format. --- default: table options: - table - csv - json - yaml - count - ids --- ## AVAILABLE FIELDS These fields will be displayed by default for each session: * token * login_time * expiration_time * ip * ua These fields are optionally available: * expiration * login ## EXAMPLES # List a user's sessions. $ wp user session list [email protected] --format=csv login_time,expiration_time,ip,ua "2016-01-01 12:34:56","2016-02-01 12:34:56",127.0.0.1,"Mozilla/5.0..."
public list_ ( $args, $assoc_args )