Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Products::on_product_trashedpublicWC 1.0

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() code WC 11.0.1

public function on_product_trashed( $post_id ) {
	if ( get_post_type( $post_id ) !== 'product' ) {
		return;
	}

	$this->revert_task_completion();
}