WP_Roles::__construct()publicWP 2.0.0

Constructor.

Метод класса: WP_Roles{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

global $wp_roles;
$wp_roles->__construct( $site_id );
$site_id(int)
Site ID to initialize roles for.
По умолчанию: current site

Заметки

  • Global. Массив. $wp_user_roles Used to set the 'roles' property value.

Список изменений

С версии 2.0.0 Введена.
С версии 4.9.0 The $site_id argument was added.

Код WP_Roles::__construct() WP 6.5.2

public function __construct( $site_id = null ) {
	global $wp_user_roles;

	$this->use_db = empty( $wp_user_roles );

	$this->for_site( $site_id );
}