WP_Metadata_Lazyloader::lazyload_term_meta()publicWP 4.5.0

Lazy-loads term meta for queued terms.

This method is public so that it can be used as a filter callback. As a rule, there is no need to invoke it directly.

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

Хуков нет.

Возвращает

Разное. In order not to short-circuit get_metadata(). Generally, this is null, but it could be another value if filtered by a plugin.

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

$WP_Metadata_Lazyloader = new WP_Metadata_Lazyloader();
$WP_Metadata_Lazyloader->lazyload_term_meta( $check );
$check(разное) (обязательный)
The $check param passed from the 'get_term_metadata' hook.

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

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

Код WP_Metadata_Lazyloader::lazyload_term_meta() WP 6.2.2

public function lazyload_term_meta( $check ) {
	if ( ! empty( $this->pending_objects['term'] ) ) {
		update_termmeta_cache( array_keys( $this->pending_objects['term'] ) );

		// No need to run again for this set of terms.
		$this->reset_queue( 'term' );
	}

	return $check;
}