woocommerce_shop_order_search_results
Filter the order ids to be returned.
Использование
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(массив)
- The order ids.
- $term(строка)
- The search term.
- $search_fields(массив)
- The search fields.
Список изменений
| С версии 3.0.0 | Введена. |
Где вызывается хук
woocommerce_shop_order_search_results
woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php 647
$order_ids = apply_filters( 'woocommerce_shop_order_search_results', $order_ids, $term, $search_fields );