Yoast\WP\SEO\MyYoast_Client\Infrastructure\Token

Token_Storage::get_option_keyprivateYoast 1.0

Returns the option key for a resource bucket.

The default bucket has no suffix and shares its key with pre-RFC-8707 installs. Explicit resource indicators get a sha1-hash suffix joined by an underscore.

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

Хуков нет.

Возвращает

Строку. The option key.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_option_key( $resource_indicator ): string;
$resource_indicator(Resource_Indicator) (обязательный)
The resource indicator.

Код Token_Storage::get_option_key() Yoast 28.3

private function get_option_key( Resource_Indicator $resource_indicator ): string {
	$key = $this->get_option_key_prefix_for_current_issuer();
	if ( $resource_indicator->is_default() ) {
		return $key;
	}

	return $key . '_' . \substr( \sha1( $resource_indicator->value() ), 0, 12 );
}