Automattic\WooCommerce\Internal\ProductFeed\Feed

WalkerProgress::from_wc_get_products_resultpublic staticWC 10.5.0

Creates a WalkerProgress instance from a WooCommerce products query result.

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

Хуков нет.

Возвращает

self.

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

$result = WalkerProgress::from_wc_get_products_result( $result ): self;
$result(stdClass) (обязательный)
The result object from wc_get_products() with total and max_num_pages properties.

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

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

Код WalkerProgress::from_wc_get_products_result() WC 10.5.2

public static function from_wc_get_products_result( \stdClass $result ): self {
	$progress = new self();

	$progress->total_count       = $result->total;
	$progress->total_batch_count = $result->max_num_pages;
	$progress->processed_items   = 0;
	$progress->processed_batches = 0;

	return $progress;
}