WPSEO_Capability_Utils::current_user_can()public staticYoast 1.0

Checks if the user has the proper capabilities.

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

Хуков нет.

Возвращает

true|false. True if the user has the proper rights.

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

$result = WPSEO_Capability_Utils::current_user_can( $capability );
$capability(строка) (обязательный)
Capability to check.

Код WPSEO_Capability_Utils::current_user_can() Yoast 23.8

public static function current_user_can( $capability ) {
	if ( $capability === 'wpseo_manage_options' ) {
		return self::has( $capability );
	}

	return self::has_any( [ 'wpseo_manage_options', $capability ] );
}