Automattic\WooCommerce\Internal\ProductFeed\Feed
WalkerProgress::from_wc_get_products_result
Creates a WalkerProgress instance from a WooCommerce products query result.
Method of the class: WalkerProgress{}
No Hooks.
Returns
self.
Usage
$result = WalkerProgress::from_wc_get_products_result( $result ): self;
- $result(stdClass) (required)
- The result object from wc_get_products() with total and max_num_pages properties.
Changelog
| Since 10.5.0 | Introduced. |
WalkerProgress::from_wc_get_products_result() WalkerProgress::from wc get products result code WC 10.8.1
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;
}