WPSEO_Sitemaps_Cache_Validator::get_validator()public staticYoast 3.2

Get the current cache validator.

Without the type the global validator is returned. This can invalidate -all- keys in cache at once.

With the type parameter the validator for that specific type can be invalidated.

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

Хуков нет.

Возвращает

Строку|null. The validator for the supplied type.

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

$result = WPSEO_Sitemaps_Cache_Validator::get_validator( $type );
$type(строка)
Provide a type for a specific type validator, empty for global validator.
По умолчанию: ''

Список изменений

С версии 3.2 Введена.

Код WPSEO_Sitemaps_Cache_Validator::get_validator() Yoast 22.4

public static function get_validator( $type = '' ) {

	$key = self::get_validator_key( $type );

	$current = get_option( $key, null );
	if ( ! is_null( $current ) ) {
		return $current;
	}

	if ( self::create_validator( $type ) ) {
		return self::get_validator( $type );
	}

	return null;
}