user_search_columns filter-hookWP 3.6.0

Filters the columns to search in a WP_User_Query search.

The default columns depend on the search term, and include 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', and 'display_name'.


add_filter( 'user_search_columns', 'wp_kama_user_search_columns_filter', 10, 3 );

 * Function for `user_search_columns` filter-hook.
 * @param string[]      $search_columns Array of column names to be searched.
 * @param string        $search         Text being searched.
 * @param WP_User_Query $query          The current WP_User_Query instance.
 * @return string[]
function wp_kama_user_search_columns_filter( $search_columns, $search, $query ){

	// filter...
	return $search_columns;
Array of column names to be searched.
Text being searched.
The current WP_User_Query instance.


Since 3.6.0 Introduced.

Where the hook is called

wp-includes/class-wp-user-query.php 739
$search_columns = apply_filters( 'user_search_columns', $search_columns, $search, $this );

Where the hook is used in WordPress

Usage not found.