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

@var array

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

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
-

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

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

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

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