WC_Products_Tracking::track_product_category_updated()publicWC 1.0

Send a Tracks event when a product category is updated.

{} Это метод класса: WC_Products_Tracking{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WC_Products_Tracking = new WC_Products_Tracking();
$WC_Products_Tracking->track_product_category_updated( $category_id );
$category_id(int) (обязательный)
Category ID.

Код WC_Products_Tracking::track_product_category_updated() WC 6.9.1

public function track_product_category_updated( $category_id ) {
	// phpcs:disable WordPress.Security.NonceVerification.Missing
	// Only track category creation from the edit product screen or the
	// category management screen (which both occur via AJAX).
	if (
		empty( $_POST['action'] ) ||
		( 'editedtag' !== $_POST['action'] && 'inline-save-tax' !== $_POST['action'] )
	) {
		return;
	}
	// phpcs:enable

	WC_Tracks::record_event( 'product_category_update' );
}