Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-user-query]

The tag has no usage guidance.

11
votes
2answers
22k views

How can I search for a worpress user by display name or a part of it?

I need to create a search page that will display anything related to the supplied search. i.e. comments containing it, events, posts, CPTs and users with that name. How can I search for users in ...
3
votes
1answer
693 views

WP_User_Query will not combine meta + normal search methods

I've been trying to run a search on user names by following the wordpress codex but it doesn't seem to work... The following query, which is copied directly from the codex, returns 0 results. However,...
2
votes
2answers
797 views

How to order WP_User_Query results to match the order of an array of user IDs?

I'm using WP_User_Query to get a list of users from my database. I'm showing specific users only via use of the include parameter. For example: $args = array( 'include' => array( 1, 3, 5, 99, ...
10
votes
3answers
12k views

How to display pagination links for WP_User_Query?

I think I'm nearly there with this, but I can't get the pagination links to show for a directory of authors I'm creating. My code is below, but I don't know how to get the links to navigate between ...
9
votes
3answers
3k views

WP_User_Query to exclude users with no posts

I see that it is possible to sort a user query by the number of posts each user has, but is it possible to exclude users with zero posts from the result? In the Wp_User_Query class there is a ...
4
votes
2answers
4k views

Searching users with WP_List_Table plugin

I am trying to devlope a plugin that will search and return my users so I can edit some other metatdata that belongs to them. I have been using the plug-in listed on the Codex as my starting point. I ...
2
votes
1answer
7k views

Getting all user metadata from user

I am trying to show bio and other custom metadata for my users in a page. So, i want to query the user metadata table for it. I have tried but did not find any functions for that. What i am looking ...
1
vote
1answer
4k views

Sort WP_User_Query by meta_key value with pre_user_query

I'm trying to order my users by their Member Number - which is a custom meta value. It seems I can't easily orderby a meta_value. I've read a few workarounds but I can't get my head around it. This is ...
3
votes
2answers
2k views

How to search display_name column when using WP_User_Query

I'm using WP_User_Query to bring back a list of users. According to this article, I can focus the query on particular columns (I'm assuming in the wp_users table) using the search_columns param. My ...
2
votes
1answer
358 views

How to display next and prev pagination links with WP_User_Query?

Looking through the pagination functions available in WordPress, most seem to be associated with posts. paginate_links() seems to be the only function which will work with WP_User_Query. However, when ...
1
vote
1answer
1k views

WP_User_Query with meta_query array relation 'OR'

I just updated to WP 4.1 and a User_Query I was using is now returning 0 instead of the expected results. $pm = array( //'role' => 'program_manager', 'orderby' => 'display_name', '...
1
vote
2answers
2k views

Ordering WP_User_Query results by the user IDs used in the include parameter

I'm using WP_User_Query to bring back a list of users. I'm passing a list of specific users to be included in results. For example: $user_ids = array( 1, 5, 9, 61, 24, 12 ); $args = array( ...
0
votes
0answers
829 views

How to get user by display_name with WP_User_Query

I'm using WP_User_Query to get user by display_name and other columns such as: user_login, user_nicename. Here is the code: $my_users = new WP_User_Query( array( 'role' =&...
0
votes
1answer
2k views

WP_User_Query Custom Field meta_query with Date clause

I have a custom meta field 'bhaa_runner_dateofrenewal' which records the date that a User on my system last renewed their membership, the field format is YYYY-MM-DD. I'm trying to write a custom query ...