Question

I am using WP_User_Query to search use by name, ID, email etc... In that case I need to use search_columns field to pass ID or email of user.

What i am doing is

$my_users = new WP_User_Query( 
                    array( 
                        'role' => $role,
                        'offset' => $offset ,
                        'number' => $number,
                        'fields' => 'all',
                        'search_columns'=> array( '5','', 'johndoe_dd@yahoo1.com','',''),
                        //'search_columns'=> $search_columns_array,
                        'meta_query' => $meta_query_array,
                    ));

For reference http://wpsmith.net/2012/wp/an-introduction-to-wp_user_query-class/

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top