Automattic\WooCommerce\Internal
AssignDefaultCategory::schedule_action()
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() AssignDefaultCategory::schedule action code WC 9.3.3
public function schedule_action() { WC()->queue()->schedule_single( time(), 'wc_schedule_update_product_default_cat', array(), 'wc_update_product_default_cat' ); }