WPSEO_Capability_Utils::get_applicable_users()public staticYoast 1.0

Retrieves the users that have the specified capability.

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

Хуков нет.

Возвращает

Массив. The users that have the capability.

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

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

Код WPSEO_Capability_Utils::get_applicable_users() Yoast 19.11

public static function get_applicable_users( $capability ) {
	$applicable_roles = self::get_applicable_roles( $capability );

	if ( $applicable_roles === [] ) {
		return [];
	}

	return get_users( [ 'role__in' => $applicable_roles ] );
}