Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
Products::on_product_trashed
Handle product trashing via the trashed_post hook.
Method of the class: Products{}
No Hooks.
Returns
void. Nothing (null).
Usage
$Products = new Products(); $Products->on_product_trashed( $post_id );
- $post_id(int) (required)
- Post ID.
Products::on_product_trashed() Products::on product trashed code WC 11.0.1
public function on_product_trashed( $post_id ) {
if ( get_post_type( $post_id ) !== 'product' ) {
return;
}
$this->revert_task_completion();
}