WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

WPSEO_Capability_Utils::get_applicable_roles() public Yoast 1.0

Retrieves the roles that have the specified capability.

{} Это метод класса: WPSEO_Capability_Utils{}

Хуков нет.

Возвращает

Массив. The names of the roles that have the capability.

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

$result = WPSEO_Capability_Utils::get_applicable_roles( $capability );
$capability(строка) (обязательный)
The name of the capability.

Код WPSEO_Capability_Utils::get_applicable_roles() Yoast 15.1.1

<?php
public static function get_applicable_roles( $capability ) {
	$roles      = wp_roles();
	$role_names = $roles->get_names();

	$applicable_roles = [];
	foreach ( array_keys( $role_names ) as $role_name ) {
		$role = $roles->get_role( $role_name );

		if ( ! $role ) {
			continue;
		}

		// Add role if it has the capability.
		if ( array_key_exists( $capability, $role->capabilities ) && $role->capabilities[ $capability ] === true ) {
			$applicable_roles[] = $role_name;
		}
	}

	return $applicable_roles;
}