woocommerce_shop_order_search_results
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
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 );