WordPress at Your Fingertips
function is not described

WC_Orders_Tracking::track_order_action() public WC 1.0

Track order actions taken.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Orders_Tracking = new WC_Orders_Tracking();
$WC_Orders_Tracking->track_order_action( $order_id );
$order_id(int) (required)
Order ID.

Code of WC_Orders_Tracking::track_order_action() WC 5.8.0

public function track_order_action( $order_id ) {
	// phpcs:disable WordPress.Security.NonceVerification
	if ( ! empty( $_POST['wc_order_action'] ) ) {
		$order      = wc_get_order( $order_id );
		$action     = wc_clean( wp_unslash( $_POST['wc_order_action'] ) );
		$properties = array(
			'order_id' => $order_id,
			'status'   => $order->get_status(),
			'action'   => $action,
		);

		WC_Tracks::record_event( 'order_edit_order_action', $properties );
	}
	// phpcs:enable
}