Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Search user in wordpress sidewide (at least at backend and if you use wp user query any where ) for user's display name , if you are here you know why I used this filter
add_filter('user_search_columns', 'user_search_columns_bd' , 10, 3);
function user_search_columns_bd($search_columns, $search, $this){
//if(!in_array($search_columns, 'display_name')){
if(!in_array('display_name', $search_columns)){
$search_columns[] = 'display_name';
return $search_columns;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment