woocommerce_shop_order_search_fields filter-hookWC 1.0

Searches on meta data can be slow - this lets you choose what fields to search.
3.0.0 added _billing_address and _shipping_address meta which contains all address data to make this faster. This however won't work on older orders unless updated, so search a few others (expand this using the filter if needed).

Usage

add_filter( 'woocommerce_shop_order_search_fields', 'wp_kama_woocommerce_shop_order_search_fields_filter' );

/**
 * Function for `woocommerce_shop_order_search_fields` filter-hook.
 * 
 * @param  $array 
 *
 * @return 
 */
function wp_kama_woocommerce_shop_order_search_fields_filter( $array ){

	// filter...
	return $array;
}
$array
-

Where the hook is called

WC_Order_Data_Store_CPT::search_orders()
woocommerce_shop_order_search_fields
woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php 573-582
apply_filters(
	'woocommerce_shop_order_search_fields',
	array(
		'_billing_address_index',
		'_shipping_address_index',
		'_billing_last_name',
		'_billing_email',
		'_billing_phone',
	)
)

Where the hook is used in WooCommerce

Usage not found.