Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Products::maybe_set_has_product_transient_on_untrashed_postpublicWC 1.0

Set the has products transient if the post qualifies as a user created product.

Method of the class: Products{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Products = new Products();
$Products->maybe_set_has_product_transient_on_untrashed_post( $post_id );
$post_id(int) (required)
Post ID.

Products::maybe_set_has_product_transient_on_untrashed_post() code WC 9.9.5

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

	$this->maybe_set_has_product_transient( $post_id, wc_get_product( $post_id ) );
}