Yoast\WP\SEO\Helpers
Capability_Helper::current_user_can
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() Capability Helper::current user can Yoast 27.7
public function current_user_can( $capability ) {
if ( $capability === 'wpseo_manage_options' ) {
return \current_user_can( $capability );
}
return $this->has_any( [ 'wpseo_manage_options', $capability ] );
}