woocommerce_shop_order_search_results filter-hookWC 3.0.0

Filter the order ids to be returned.

Usage

add_filter( 'woocommerce_shop_order_search_results', 'wp_kama_woocommerce_shop_order_search_results_filter', 10, 3 );

/**
 * Function for `woocommerce_shop_order_search_results` filter-hook.
 * 
 * @param array  $order_ids     The order ids.
 * @param string $term          The search term.
 * @param array  $search_fields The search fields.
 *
 * @return array
 */
function wp_kama_woocommerce_shop_order_search_results_filter( $order_ids, $term, $search_fields ){

	// filter...
	return $order_ids;
}
$order_ids(array)
The order ids.
$term(string)
The search term.
$search_fields(array)
The search fields.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

WC_Order_Data_Store_CPT::search_orders()
woocommerce_shop_order_search_results
woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php 695
$order_ids = apply_filters( 'woocommerce_shop_order_search_results', $order_ids, $term, $search_fields );

Where the hook is used in WooCommerce

Usage not found.