Yoast\WP\SEO\MyYoast_Client\Domain

Token_Set::has_scopes │ public │ Yoast 1.0

Checks if the token set has the required scope(s). Returns true if AT LEAST all required scopes are granted, false otherwise.

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

Хуков нет.

Возвращает

bool. True if all required scopes are granted, false otherwise.

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

$Token_Set = new Token_Set();
$Token_Set->has_scopes( $required_scopes ): bool;
$required_scopes(string[]) (обязательный)
The required scopes as an array of strings.

Код Token_Set::has_scopes() Yoast 28.9

public function has_scopes( array $required_scopes ): bool {
	if ( $this->scope === null ) {
		return \count( $required_scopes ) === 0;
	}
	$granted_scopes = \explode( ' ', $this->scope );
	return \count( \array_diff( $required_scopes, $granted_scopes ) ) === 0;
}