Automattic\WooCommerce\Internal\ProductFeed\Feed
ProductWalker::walk
Walks through every remaining product in one go, managing the feed lifecycle.
This is the simple, single-process entry point: it starts the feed, walks every batch, ends the feed and returns the number of products processed. Callers that need to write a feed across several processes should own the feed lifecycle themselves and use {@see walk_batches()} instead.
Метод класса: ProductWalker{}
Хуков нет.
Возвращает
int. The number of products processed.
Использование
$ProductWalker = new ProductWalker(); $ProductWalker->walk( ?callable $callback ): int;
- ?callable $callback
- .
По умолчанию:null
Список изменений
| С версии 10.5.0 | Введена. |
Код ProductWalker::walk() ProductWalker::walk WC 11.2.2
public function walk( ?callable $callback = null ): int {
$this->feed->start();
$progress = $this->walk_batches( $callback );
$this->feed->end();
return $progress->processed_items;
}