Yoast\WP\SEO\Memoizers
Meta_Tags_Context_Memoizer::clear
Clears the memoization of either a specific indexable or all indexables.
Метод класса: Meta_Tags_Context_Memoizer{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$Meta_Tags_Context_Memoizer = new Meta_Tags_Context_Memoizer(); $Meta_Tags_Context_Memoizer->clear( $indexable );
- $indexable(Indexable|int|строка|null)
- The indexable or indexable id to clear the memoization of.
По умолчанию:null
Код Meta_Tags_Context_Memoizer::clear() Meta Tags Context Memoizer::clear Yoast 28.4
public function clear( $indexable = null ) {
if ( $indexable instanceof Indexable ) {
unset( $this->cache[ $indexable->id ] );
$this->presentation_memoizer->clear( $indexable->id );
return;
}
if ( $indexable !== null ) {
unset( $this->cache[ $indexable ] );
$this->presentation_memoizer->clear( $indexable );
return;
}
$this->cache = [];
$this->presentation_memoizer->clear();
}