WPSEO_Abstract_Capability_Manager::get_wp_rolesprotectedYoast 1.0

Returns a list of WP_Role roles.

The string array of role names are converted to actual WP_Role objects. These are needed to be able to use the API on them.

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

Хуков нет.

Возвращает

WP_Role[]. List of WP_Role objects.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_wp_roles( $roles );
$roles(массив) (обязательный)
Roles to retrieve the objects for.

Код WPSEO_Abstract_Capability_Manager::get_wp_roles() Yoast 25.3

protected function get_wp_roles( array $roles ) {
	$wp_roles = array_map( 'get_role', $roles );

	return array_filter( $wp_roles );
}