WordPress at Your Fingertips
function is not described

WC_Orders_Tracking::track_order_search() public WC 1.0

Send a track event when on the Order Listing page, and search results are being displayed.

{} 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_search( $order_ids, $term, $search_fields );
$order_ids(array) (required)
Array of order_ids that are matches for the search.
$term(string) (required)
The string that was used in the search.
$search_fields(array) (required)
Fields that were used in the original search.

Code of WC_Orders_Tracking::track_order_search() WC 5.8.0

public function track_order_search( $order_ids, $term, $search_fields ) {
	// Since `woocommerce_shop_order_search_results` can run in the front-end context, exit if get_current_screen isn't defined.
	if ( ! function_exists( 'get_current_screen' ) ) {
		return $order_ids;
	}

	$screen = get_current_screen();

	// We only want to record this track when the filter is executed on the order listing page.
	if ( 'edit-shop_order' === $screen->id ) {
		// we are on the order listing page, and query results are being shown.
		WC_Tracks::record_event( 'orders_view_search' );
	}

	return $order_ids;
}