WC_Products_Tracking::track_product_updated()publicWC 1.0

Send a Tracks event when a product is updated.

Method of the class: WC_Products_Tracking{}

No Hooks.

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

public function track_product_updated( $product_id, $post ) {
	if ( 'product' !== $post->post_type ) {
		return;
	}

	$properties = array(
		'product_id' => $product_id,
	);

	WC_Tracks::record_event( 'product_edit', $properties );
}