Automattic\WooCommerce\Internal

AssignDefaultCategory::schedule_action()publicWC 1.0

When a product category is deleted, we need to check if the product has no categories assigned. Then assign it a default category. We delay this with a scheduled action job to not block the response.

Method of the class: AssignDefaultCategory{}

No Hooks.

Return

null. Nothing (null).

Usage

$AssignDefaultCategory = new AssignDefaultCategory();
$AssignDefaultCategory->schedule_action();

AssignDefaultCategory::schedule_action() code WC 8.7.0

public function schedule_action() {
	WC()->queue()->schedule_single(
		time(),
		'wc_schedule_update_product_default_cat',
		array(),
		'wc_update_product_default_cat'
	);
}