Method | Description | |
---|---|---|
__construct ( ) | Class constructor. Handles hooking actions and filters, and sets some properties. | |
action_admin_init ( ) | Hooks the admin_init action to run an update method. | |
action_init ( ) | Hooks the init action to add the role, covering the cases where we should be using wpcom_vip_add_role. | |
filter_editable_roles ( array $roles ) : array | Hooks the editable_roles filter to place the VIP Support at the bottom of any roles listing. | |
filter_user_has_cap ( array $user_caps, array $caps, array $args, WP_User $user ) : array | Hooks the user_has_cap filter to allow VIP Support role users to do EVERYTHING | |
init ( ) : WPCOM_VIP_Support_Role | Initiate an instance of this class if one doesn't exist already. Return the VipSupportRole instance. |
Method | Description | |
---|---|---|
add_role ( ) | ||
error_log ( string $message ) | Log errors if WP_DEBUG is defined and true. | |
update ( ) | Checks the version option value against the version property value, and runs update routines as appropriate. |
public __construct ( ) |
public action_admin_init ( ) |
public action_init ( ) |
public filter_editable_roles ( array $roles ) : array | ||
$roles | array | An array of WP role data |
return | array | An array of WP role data |
public filter_user_has_cap ( array $user_caps, array $caps, array $args, WP_User $user ) : array | ||
$user_caps | array | An array of all the user's capabilities. |
$caps | array | Actual capabilities for meta capability. |
$args | array | Optional parameters passed to has_cap(), typically object ID. |
$user | WP_User | The user object. |
return | array | An array of all the user's caps, with the required cap added |
public static init ( ) : WPCOM_VIP_Support_Role | ||
return | WPCOM_VIP_Support_Role | object The instance of WPCOM_VIP_Support_Role |
protected update ( ) |