WordPress at Your Fingertips
function is not described

WC_Products_Tracking::track_product_published() public WC 1.0

Send a Tracks event when a product is published.

{} It's a method of the class: WC_Products_Tracking{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Products_Tracking = new WC_Products_Tracking();
$WC_Products_Tracking->track_product_published( $new_status, $old_status, $post );
$new_status(string) (required)
New post_status.
$old_status(string) (required)
Previous post_status.
$post(object) (required)
WordPress post.

Code of WC_Products_Tracking::track_product_published() WC 5.8.0

public function track_product_published( $new_status, $old_status, $post ) {
	if (
		'product' !== $post->post_type ||
		'publish' !== $new_status ||
		'publish' === $old_status
	) {
		return;
	}

	$properties = array(
		'product_id' => $post->ID,
	);

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