Yoast\WP\SEO\Memoizers
Presentation_Memoizer::clear
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() Presentation Memoizer::clear Yoast 26.7
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 = [];
}
}