Yoast\WP\SEO\Memoizers

Presentation_Memoizer::clear()publicYoast 1.0

Clears the memoization of either a specific indexable or all indexables.

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

Хуков нет.

Возвращает

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

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

$Presentation_Memoizer = new Presentation_Memoizer();
$Presentation_Memoizer->clear( $indexable );
$indexable(Indexable|int|null)
The indexable or indexable id to clear the memoization of.
По умолчанию: null

Код Presentation_Memoizer::clear() Yoast 22.4

public function clear( $indexable = null ) {
	if ( $indexable instanceof Indexable ) {
		unset( $this->cache[ $indexable->id ] );
		return;
	}
	if ( \is_int( $indexable ) ) {
		unset( $this->cache[ $indexable ] );
		return;
	}
	if ( $indexable === null ) {
		$this->cache = [];
	}
}