wc_order_search

Search orders.

Description

(array) wc_order_search( (string) $term ); 

Returns (array)

List of orders ID.

Parameters (1)

0. $term (string)
Term to search.

Usage

  1. if ( !function_exists( 'wc_order_search' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-order-functions.php'; 
  3.  
  4. // Term to search. 
  5. $term = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_order_search($term); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-order-functions.php  
  1. function wc_order_search( $term ) { 
  2. $data_store = WC_Data_Store::load( 'order' ); 
  3. return $data_store->search_orders( str_replace( 'Order #', '', wc_clean( $term ) ) );