PHP Class WPAS_User

Author: Julien Liabeuf ([email protected])
Show file Open project: awesome-support/awesome-support Class Usage Examples

Protected Properties

Property Type Description
$instance object Instance of this class.

Public Methods

Method Description
__construct ( )
auto_assignment_user_column ( array $columns ) : mixed Add auto-assignment column in users table
auto_assignment_user_column_content ( mixed $value, string $column_name, integer $user_id ) : string Add auto-assignment user column content
enable_assignment ( integer $user_id ) : void Enable auto-assignment for new agents
get_instance ( ) : object Return an instance of this class.
maybe_enable_assignment ( integer $user_id, array $old_data ) : void Maybe enable auto assignment for this user
profile_field_after_reply ( WP_User $user ) : void User profile field "after reply"
profile_field_agent_department ( WP_User $user ) : void User profile field "departments"
profile_field_smart_tickets_order ( WP_User $user ) : void User profile field "tickets order"
profile_field_user_can_be_assigned ( WP_User $user ) : void User profile field "can be assigned"
save_user_custom_fields ( integer $user_id ) : void Save the user preferences.
user_profile_custom_fields ( WP_User $user ) : boolean | void Add user preferences to the profile page.

Method Details

__construct() public method

public __construct ( )

auto_assignment_user_column() public method

Add auto-assignment column in users table
Since: 3.2
public auto_assignment_user_column ( array $columns ) : mixed
$columns array
return mixed

auto_assignment_user_column_content() public method

Add auto-assignment user column content
Since: 3.2
public auto_assignment_user_column_content ( mixed $value, string $column_name, integer $user_id ) : string
$value mixed Column value
$column_name string Column name
$user_id integer Current user ID
return string

enable_assignment() public method

Enable auto-assignment for new agents
Since: 3.2
public enable_assignment ( integer $user_id ) : void
$user_id integer
return void

get_instance() public static method

Return an instance of this class.
Since: 3.0.0
public static get_instance ( ) : object
return object A single instance of this class.

maybe_enable_assignment() public method

Unfortunately there is no way to know what were the previous user capabilities which makes it impossible to safely enable auto-assignment. We are not able to differentiate a user being upgraded to support agent from a user who already was an agent but deactivated auto assignment and updated his profile.
Since: 3.2
public maybe_enable_assignment ( integer $user_id, array $old_data ) : void
$user_id integer
$old_data array
return void

profile_field_after_reply() public method

User profile field "after reply"
Since: 3.1.5
public profile_field_after_reply ( WP_User $user ) : void
$user WP_User
return void

profile_field_agent_department() public method

User profile field "departments"
Since: 3.3
public profile_field_agent_department ( WP_User $user ) : void
$user WP_User
return void

profile_field_smart_tickets_order() public method

Let the user selects the order in which his tickets appear in the tickets list screen.
Since: 3.3.2
public profile_field_smart_tickets_order ( WP_User $user ) : void
$user WP_User
return void

profile_field_user_can_be_assigned() public method

User profile field "can be assigned"
Since: 3.1.5
public profile_field_user_can_be_assigned ( WP_User $user ) : void
$user WP_User
return void

save_user_custom_fields() public method

Save the user preferences.
Since: 3.0.0
public save_user_custom_fields ( integer $user_id ) : void
$user_id integer ID of the user to modify
return void

user_profile_custom_fields() public method

Add user preferences to the profile page.
Since: 3.0.0
public user_profile_custom_fields ( WP_User $user ) : boolean | void
$user WP_User
return boolean | void

Property Details

$instance protected static property

Instance of this class.
Since: 1.0.0
protected static object $instance
return object