wc_order_search()WC 2.6.0

Search orders.

No Hooks.

Return

Array. List of orders ID.

Usage

wc_order_search( $term );
$term(string) (required)
Term to search.

Changelog

Since 2.6.0 Introduced.

wc_order_search() code WC 8.7.0

function wc_order_search( $term ) {
	$data_store = WC_Data_Store::load( 'order' );
	return $data_store->search_orders( str_replace( 'Order #', '', wc_clean( $term ) ) );
}