Automattic\WooCommerce\Internal\ProductFeed\Feed

ProductWalker::walk_batches │ public │ WC 11.0.0

Deprecated since 1.3.0. It is no longer supported and may be removed in future releases. Use walk_chunk(), which resumes after a product ID of a page instead.

Walks the first chunk of products and reports it as the whole feed.

This class is internal and nothing outside WooCommerce should call this method. It's kept only so that any unexpected caller gets a deprecation notice instead of a fatal error that takes the site down. Resuming from a page is no longer supported, so $start_page is ignored.

Method of the class: ProductWalker{}

No Hooks.

Returns

WalkerProgress.

Usage

$ProductWalker = new ProductWalker();
$ProductWalker->walk_batches( ?callable $callback, $start_page, $max_batches ): WalkerProgress;
?callable $callback
.
Default: null
$start_page(int)
Ignored.
Default: 1
$max_batches(int)
The maximum number of batches to process in this call.
Default: PHP_INT_MAX

Changelog

Since 11.0.0 Introduced.
Deprecated since 11.3.0 Use walk_chunk(), which resumes after a product ID instead of a page.

ProductWalker::walk_batches() code WC 11.3.0

public function walk_batches( ?callable $callback = null, int $start_page = 1, int $max_batches = PHP_INT_MAX ): WalkerProgress {
	wc_deprecated_function( __METHOD__, '11.3.0', __CLASS__ . '::walk_chunk' );

	$progress                    = $this->walk_chunk( $callback, 0, $max_batches );
	$progress->total_count       = $progress->processed_items;
	$progress->total_batch_count = $progress->processed_batches;

	return $progress;
}