Automattic\WooCommerce\Internal\ProductFeed\Feed

ProductWalker::walkpublicWC 10.5.0

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.

Method of the class: ProductWalker{}

No Hooks.

Returns

Int. The number of products processed.

Usage

$ProductWalker = new ProductWalker();
$ProductWalker->walk( ?callable $callback ): int;
?callable $callback
.
Default: null

Changelog

Since 10.5.0 Introduced.

ProductWalker::walk() code WC 11.0.0

public function walk( ?callable $callback = null ): int {
	$this->feed->start();
	$progress = $this->walk_batches( $callback );
	$this->feed->end();

	return $progress->processed_items;
}