Yoast\WP\SEO\AI\Consent\User_Interface

Consent_Route::check_permissionspublicYoast 1.0

Checks:

  • if the user is logged
  • if the user can edit posts

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

Хуков нет.

Возвращает

true|false. Whether the user is logged in, can edit posts and the feature is active.

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

$Consent_Route = new Consent_Route();
$Consent_Route->check_permissions(): bool;

Код Consent_Route::check_permissions() Yoast 28.3

public function check_permissions(): bool {
	$user = \wp_get_current_user();
	if ( $user === null || $user->ID < 1 ) {
		return false;
	}

	return \user_can( $user, 'edit_posts' );
}