woocommerce_cot_shop_order_search_results filter-hookWC 7.0.0

Provides an opportunity to modify the list of order IDs obtained during an order search.

This hook is used for Custom Order Table queries. For Custom Post Type order searches, the corresponding hook is woocommerce_shop_order_search_results.

Usage

add_filter( 'woocommerce_cot_shop_order_search_results', 'wp_kama_woocommerce_cot_shop_order_search_results_filter', 10, 2 );

/**
 * Function for `woocommerce_cot_shop_order_search_results` filter-hook.
 * 
 * @param int[]  $order_ids Search results as an array of order IDs.
 * @param string $term      The search term.
 *
 * @return int[]
 */
function wp_kama_woocommerce_cot_shop_order_search_results_filter( $order_ids, $term ){

	// filter...
	return $order_ids;
}
$order_ids(int[])
Search results as an array of order IDs.
$term(string)
The search term.

Changelog

Since 7.0.0 Introduced.

Where the hook is called

OrdersTableDataStore::search_orders()
woocommerce_cot_shop_order_search_results
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 1053
return array_map( 'intval', (array) apply_filters( 'woocommerce_cot_shop_order_search_results', $order_ids, $term ) );

Where the hook is used in WooCommerce

Usage not found.