woocommerce_cot_shop_order_search_results хук-фильтрWC 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.

Использование

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(строка)
The search term.

Список изменений

С версии 7.0.0 Введена.

Где вызывается хук

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

Где используется хук в WooCommerce

Использование не найдено.