Yoast\WP\SEO\Helpers

Capability_Helper::current_user_can()publicYoast 1.0

Checks if the user has at least one of the proper capabilities.

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

Хуков нет.

Возвращает

true|false. True if the user has at least one of the proper rights.

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

$Capability_Helper = new Capability_Helper();
$Capability_Helper->current_user_can( $capability );
$capability(строка) (обязательный)
Capability to check.

Код Capability_Helper::current_user_can() Yoast 22.4

public function current_user_can( $capability ) {
	if ( $capability === 'wpseo_manage_options' ) {
		return \current_user_can( $capability );
	}

	return $this->has_any( [ 'wpseo_manage_options', $capability ] );
}