Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
Products::maybe_set_has_product_transient_on_untrashed_post
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() Products::maybe set has product transient on untrashed post code WC 11.0.1
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 ) );
}