User_Account
in package
User account profile maintenance functionality.
- Applies to any person with login credentials.
Tags
Table of Contents
Constants
- ACCOUNT_EDIT_PAGE = 'edit-account'
- The user profile edit page.
Properties
- $account_edit_url : string
- The fully qualified path to the user account edit page.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
Methods
- cancel_email_change() : bool
- Cancel a pending email change.
- cancel_password_change() : bool
- Cancel a pending password change.
- email_change_confirm() : bool
- Updates user data to use confirmed email address.
- get_account_edit_url() : string
- Return the user edit account page url.
- get_action_url() : string
- Return the URL with the profile edit action to take and the key.
- get_instance() : object
- Creates and/or returns the instance of this class.
- reset_password() : WP_Error
- Trigger the password reset process.
- __construct() : void
- Initialise the class.
Constants
ACCOUNT_EDIT_PAGE
The user profile edit page.
protected
string
ACCOUNT_EDIT_PAGE
= 'edit-account'
Tags
Properties
$account_edit_url
The fully qualified path to the user account edit page.
protected
string
$account_edit_url
= ''
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
Methods
cancel_email_change()
Cancel a pending email change.
public
cancel_email_change(int $user_id) : bool
Parameters
- $user_id : int
-
Cancel email change request for this user.
Tags
Return values
bool —Success or failure.
cancel_password_change()
Cancel a pending password change.
public
cancel_password_change(int $user_id) : bool
Parameters
- $user_id : int
-
Cancel password change request for this user.
Tags
Return values
bool —Success or failure.
email_change_confirm()
Updates user data to use confirmed email address.
public
email_change_confirm([array<string|int, string> $get_vars = array() ]) : bool
Parameters
- $get_vars : array<string|int, string> = array()
-
{ The sanitised $_GET arguments, including a nonce. @type string $key The hashed new email address. }
Tags
Return values
bool —Success or failure.
get_account_edit_url()
Return the user edit account page url.
public
get_account_edit_url() : string
Tags
Return values
string —The user edit account page url.
get_action_url()
Return the URL with the profile edit action to take and the key.
public
get_action_url([string $action = '' ][, string $key = '' ]) : string
Parameters
- $action : string = ''
-
The action to take.
- $key : string = ''
-
The hashed new email address or activation key.
Tags
Return values
string —The URL for the action.
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
reset_password()
Trigger the password reset process.
public
reset_password(int $user_id, WP_Error $errors) : WP_Error
Parameters
- $user_id : int
-
The user id requesting password reset.
- $errors : WP_Error
-
The WP_Error object to use if errors.
Tags
Return values
WP_Error —The maybe modified error object.
__construct()
Initialise the class.
protected
__construct() : void