WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

WP_Metadata_Lazyloader::queue_objects() public WP 4.5.0

Adds objects to the metadata lazy-load queue.

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

Хуки из метода
Возвращает

true/false/WP_Error. True on success, WP_Error on failure.

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

$WP_Metadata_Lazyloader = new WP_Metadata_Lazyloader();
$WP_Metadata_Lazyloader->queue_objects( $object_type, $object_ids );
$object_type(строка) (обязательный)
Type of object whose meta is to be lazy-loaded. Accepts 'term' or 'comment'.
$object_ids(массив) (обязательный)
Array of object IDs.

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

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

Код WP_Metadata_Lazyloader::queue_objects() WP 5.5.3

<?php
public function queue_objects( $object_type, $object_ids ) {
	if ( ! isset( $this->settings[ $object_type ] ) ) {
		return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );
	}

	$type_settings = $this->settings[ $object_type ];

	if ( ! isset( $this->pending_objects[ $object_type ] ) ) {
		$this->pending_objects[ $object_type ] = array();
	}

	foreach ( $object_ids as $object_id ) {
		// Keyed by ID for faster lookup.
		if ( ! isset( $this->pending_objects[ $object_type ][ $object_id ] ) ) {
			$this->pending_objects[ $object_type ][ $object_id ] = 1;
		}
	}

	add_filter( $type_settings['filter'], $type_settings['callback'] );

	/**
	 * Fires after objects are added to the metadata lazy-load queue.
	 *
	 * @since 4.5.0
	 *
	 * @param array                  $object_ids  Array of object IDs.
	 * @param string                 $object_type Type of object being queued.
	 * @param WP_Metadata_Lazyloader $lazyloader  The lazy-loader object.
	 */
	do_action( 'metadata_lazyloader_queued_objects', $object_ids, $object_type, $this );
}