WPSEO_Sitemaps_Cache::clear_on_option_update()public staticYoast 3.2

Clears the transient cache when a given option is updated, if that option has been registered before.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = WPSEO_Sitemaps_Cache::clear_on_option_update( $option );
$option(строка) (обязательный)
The option name that's being updated.

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

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

Код WPSEO_Sitemaps_Cache::clear_on_option_update() Yoast 22.4

public static function clear_on_option_update( $option ) {

	if ( array_key_exists( $option, self::$cache_clear ) ) {

		if ( empty( self::$cache_clear[ $option ] ) ) {
			// Clear all caches.
			self::clear();
		}
		else {
			// Clear specific provided type(s).
			$types = (array) self::$cache_clear[ $option ];
			self::clear( $types );
		}
	}
}