woocommerce_customer_search_customers
Usage
add_filter( 'woocommerce_customer_search_customers', 'wp_kama_woocommerce_customer_search_customers_filter', 10, 4 );
/**
* Function for `woocommerce_customer_search_customers` filter-hook.
*
* @param $array
* @param $term
* @param $limit
* @param $string
*
* @return
*/
function wp_kama_woocommerce_customer_search_customers_filter( $array, $term, $limit, $string ){
// filter...
return $array;
}
- $array
- -
- $term
- -
- $limit
- -
- $string
- -
Where the hook is called
woocommerce_customer_search_customers
woocommerce/includes/data-stores/class-wc-customer-data-store.php 583-594
apply_filters( 'woocommerce_customer_search_customers', array( 'search' => '*' . esc_attr( $term ) . '*', 'search_columns' => array( 'user_login', 'user_url', 'user_email', 'user_nicename', 'display_name' ), 'fields' => 'ID', 'number' => $limit, ), $term, $limit, 'main_query' )
woocommerce/includes/data-stores/class-wc-customer-data-store.php 598-620
apply_filters( 'woocommerce_customer_search_customers', array( 'fields' => 'ID', 'number' => $limit, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'first_name', 'value' => $term, 'compare' => 'LIKE', ), array( 'key' => 'last_name', 'value' => $term, 'compare' => 'LIKE', ), ), ), $term, $limit, 'meta_query' )