WC_Products_Tracking::track_product_updated()
Send a Tracks event when a product is updated.
Method of the class: WC_Products_Tracking{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$WC_Products_Tracking = new WC_Products_Tracking(); $WC_Products_Tracking->track_product_updated( $product_id, $post );
- $product_id(int) (required)
- Product id.
- $post(object) (required)
- WordPress post.
WC_Products_Tracking::track_product_updated() WC Products Tracking::track product updated code WC 9.8.2
public function track_product_updated( $product_id, $post ) { if ( 'product' !== $post->post_type ) { return; } /* phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment */ $source = apply_filters( 'woocommerce_product_source', self::is_importing() ? 'import' : self::TRACKS_SOURCE ); $properties = array( 'product_id' => $product_id, 'source' => $source, ); /* phpcs: enable */ WC_Tracks::record_event( 'product_edit', $properties ); }