PHP Класс WPAS_User

Автор: Julien Liabeuf ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$instance object Instance of this class.

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

public __construct ( )

auto_assignment_user_column() публичный Метод

Add auto-assignment column in users table
С версии: 3.2
public auto_assignment_user_column ( array $columns ) : mixed
$columns array
Результат mixed

auto_assignment_user_column_content() публичный Метод

Add auto-assignment user column content
С версии: 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
Результат string

enable_assignment() публичный Метод

Enable auto-assignment for new agents
С версии: 3.2
public enable_assignment ( integer $user_id ) : void
$user_id integer
Результат void

get_instance() публичный статический Метод

Return an instance of this class.
С версии: 3.0.0
public static get_instance ( ) : object
Результат object A single instance of this class.

maybe_enable_assignment() публичный Метод

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.
С версии: 3.2
public maybe_enable_assignment ( integer $user_id, array $old_data ) : void
$user_id integer
$old_data array
Результат void

profile_field_after_reply() публичный Метод

User profile field "after reply"
С версии: 3.1.5
public profile_field_after_reply ( WP_User $user ) : void
$user WP_User
Результат void

profile_field_agent_department() публичный Метод

User profile field "departments"
С версии: 3.3
public profile_field_agent_department ( WP_User $user ) : void
$user WP_User
Результат void

profile_field_smart_tickets_order() публичный Метод

Let the user selects the order in which his tickets appear in the tickets list screen.
С версии: 3.3.2
public profile_field_smart_tickets_order ( WP_User $user ) : void
$user WP_User
Результат void

profile_field_user_can_be_assigned() публичный Метод

User profile field "can be assigned"
С версии: 3.1.5
public profile_field_user_can_be_assigned ( WP_User $user ) : void
$user WP_User
Результат void

save_user_custom_fields() публичный Метод

Save the user preferences.
С версии: 3.0.0
public save_user_custom_fields ( integer $user_id ) : void
$user_id integer ID of the user to modify
Результат void

user_profile_custom_fields() публичный Метод

Add user preferences to the profile page.
С версии: 3.0.0
public user_profile_custom_fields ( WP_User $user ) : boolean | void
$user WP_User
Результат boolean | void

Описание свойств

$instance защищенное статическое свойство

Instance of this class.
С версии: 1.0.0
protected static object $instance
Результат object