WPSEO_Sitemaps_Cache_Validator::get_validator
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() WPSEO Sitemaps Cache Validator::get validator Yoast 27.3
public static function get_validator( $type = '' ) {
$key = self::get_validator_key( $type );
$current = get_option( $key, null );
if ( $current !== null ) {
return $current;
}
if ( self::create_validator( $type ) ) {
return self::get_validator( $type );
}
return null;
}