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

Yoast\WP\SEO\Helpers

Capability_Helper::get_applicable_roles() public Yoast 1.0

Retrieves the roles that have the specified capability.

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

Хуков нет.

Возвращает

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

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

$Capability_Helper = new Capability_Helper();
$Capability_Helper->get_applicable_roles( $capability );
$capability(строка) (обязательный)
The name of the capability.

Код Capability_Helper::get_applicable_roles() Yoast 15.6.2

<?php
public 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;
}