OrdersTableDataStore::search_orders()publicWC 1.0

Search order data for a term and return matching order IDs.

Метод класса: OrdersTableDataStore{}

Хуки из метода


int[]. Array of order IDs.


$OrdersTableDataStore = new OrdersTableDataStore();
$OrdersTableDataStore->search_orders( $term );
$term(строка) (обязательный)
Search term.

Код OrdersTableDataStore::search_orders() WC 8.5.2

public function search_orders( $term ) {
	$order_ids = wc_get_orders(
			's'      => $term,
			'return' => 'ids',

	 * 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`.
	 * @since 7.0.0
	 * @param int[]  $order_ids Search results as an array of order IDs.
	 * @param string $term      The search term.
	return array_map( 'intval', (array) apply_filters( 'woocommerce_cot_shop_order_search_results', $order_ids, $term ) );