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.

1
vote
2answers
48 views

Conditional IF statement not returning true even though echo of $user->province is correct

I am having a problem with an if statement which I have now tested many times over. $user_query = new WP_User_Query( array( 'role' => 'Subscriber' ) ); if ( !empty( $user_query-&...
0
votes
2answers
67 views

Why Am I getting an error when I add the number parameter to my WP_User_Query?

I have a custom WP_Users_Query that I have been using on a site. It has worked fine for a while. I went to add some pagination to the query using the number parameter as per the docs here. But for ...
0
votes
2answers
717 views

WP_User_Query not returning users with meta - what am I missing?

I think I'm missing a step here, but for the life of me I can't see it. I'm trying to display a simple list of users who all have the same role and have the same meta data value for a certain key - ...
4
votes
1answer
480 views

Wp_User_Query not sorting by meta key

I'm trying to list users sorted by a meta value. I store a score for each user in their user meta which is just a number but the loop isn't sorting. I include the score in the loop so that I can see ...
1
vote
1answer
35 views

Upload Video and preview

I have a question about videos in WordPress. Is it possible to let my users upload videos and show the preview in their profiles? Not have a video post page, just the user can see a preview in low ...
0
votes
1answer
31 views

How to query 5 users in random who have published more than 10 posts

I want to display 5 users who have published more than 10 posts, when the page loaded again, it should show another 5 users or mixed with new users with more than 10 posts. How do I achieve this? ...
0
votes
1answer
172 views

Problem with WP_User_Query when 'meta_value' is an array

I have a problem with listing my users, who have a birthday today (for this instance today is March 3rd). I've created a custom field 'birth_date' using tutorial here with some minor tweaks. My ...
0
votes
1answer
495 views

WP User Query with meta queries

I'm having some problems when comparing integer values '>=' or '<=' with meta_queries with the WP_USER_QUERY. Let say I've stored the following meta keys with the meta values below: meta_key ...
0
votes
1answer
65 views

Loop 1 user randomly

At the moment I am using wp_user_query to loop users from a specific role(leden) on a webpage. For the overview page this is working fine, but on my homepage I want to feature one random user. I was ...
0
votes
1answer
372 views

How to order users alphabetically by name? in plugin UPME

I have this code: <?php class UPME_List_Cards { public $upme_options; public function __construct() { global $upme; add_shortcode('upme_latest_members_list', array($this,'...
0
votes
1answer
1k views

Wp_user_query search by meta_key not returning any results

I have a search form, and im trying to have it be able to search both the basic user field (user_email, display_name, etc), plus 1 other custom user meta key called "clinic" heres the argument i have ...
0
votes
1answer
441 views

WP_User_Query is Not Displaying Results

I'm trying to create a table with a list of users and it only seems to work when I have it set up like this: $user_report_query = new WP_User_Query( array( 'role' => 'Administrator' ) ); The ...
0
votes
1answer
193 views

How to order custom user list columns by datetime?

I am trying to add the ordering options to some custom user list columns I added in the Wordpress admin. This is my code : function mmm_user_sortable_columns_query( $userquery ){ if( 'test_date' ...
0
votes
1answer
214 views

Search Functionality broken by the wp 4.2 update

I run a blog site with posts by authors, and I implemented a search that would return results if the search was like an author's name or the search term was contained in a story. I was functioning and ...
0
votes
1answer
236 views

How can I include user meta information in the resulting array of a WP_User_Query?

I'm trying to accomplish some fairly complex custom functionality on a custom WordPress site. The client has an 'About Us' page that includes a list of all team members and their pictures. We're ...
0
votes
1answer
560 views

Query Users by post count, last 30 days and display each users post count according to post type

I'm almost done, the code below does everything but display post count for each user broken down into post types, and also I'm like to filter it last thirty days. I'm trying to get the post for each ...
0
votes
1answer
92 views

How do I find users by password?

I need to add a passkey to each user, so I decided to just giving the user password that value and use WP functionality to store it/retrieve it. So now I need to find what user that password belongs ...
1
vote
0answers
32 views

WP_User_Query - searching multiple fields

I have a search engine where I can search for users on the front end. Profiles have mulitple custom fields. I'm just searching first and last name in this example. The problem is I can search for a ...
1
vote
0answers
22 views

What's the proper way to add users to my site in order to test things?

I'm new to wordpress. I'm have my site just running on localhost and want to test some things out with dummy data/made up users. When I log in to my wordpress database, I see that there is a table ...
1
vote
0answers
493 views

Is there a maximum limit of the number of users returns by WP_User_Query?

I’m working on a search form which filters the users . Everything works but the result is always limited to 299 users. Here is my code which is vers basic : $args = array( 'orderby' => '...
1
vote
0answers
106 views

Two queries for a WP_User_Query search work perfectly apart, but not together

I'm putting together a page that pulls User data and displays it in an attractive social-media-like format. I want to use a variable passed in through an input on the site to search multiple fields, ...
1
vote
0answers
98 views

Passing args to WP_User_Query am I using meta correctly?

I am hoping someone with more expertise can help me here. I tried passing specific args but the script wouldn't work as expected. Basically it lists all users who ticked a custom tick box that says ...
1
vote
0answers
501 views

WP_User_Query search with multiple search queries

Is it possible to perform a WP_User_Query with multiple search queries? Something like: $args = array ( 'search' => '*example.com OR *abc.com', 'search_columns' => array( 'user_email'...
1
vote
0answers
48 views

WP User Query Issues

I am trying to create a search of users to search for them using their first name, last name, billing phone, ID, or email. I have the following code written, but it does not pull in the correct data. ...
1
vote
0answers
45 views

Accessing current users data within a plugin

I have been working on a WordPress plugin for a couple of days, and I got it to the point where it works - I was however unhappy with the procedural code (I was rushing it for my site, to come back to ...
0
votes
0answers
41 views

Query users by custom field

I want to get the users who registered within last 7 days, and meanwhile who have uploaded custom avatar. I've added a function allowing users to upload their own avatar img with a custom field ...
0
votes
0answers
95 views

Users front end search using WP_User_Query in foreach loop

I'm looking to output a link to the users profile link so the searched username is clickable, please see the following code that's sitting in search.php: <?php $...
0
votes
0answers
27 views

unable to modify user table search results based on meta key

I would like to modify the pre_user-query wp_user_query to include a meta fields from the user meta. I have tried the two following methods, neither of which work (both return empty sets): $query-&...
0
votes
0answers
44 views

WP_User_Query not searching numbers?

I'm running this code: $users = new WP_User_Query( array( 'search' => '*63.19-4-00*', 'meta_query' => array( 'relation' => 'OR', array('key' => 'field_1'...
0
votes
0answers
108 views

How can I fetch all users who are at or above X role?

What is the best way to get all users who are above a certain role, like 'author'? Is this the best way? $user_args = array( 'meta_query' => array( array( 'key' => '...
0
votes
0answers
812 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
0answers
321 views

Paginate Links not working

For the life of me I cannot get Paginate links to display pagination, but using 'userp' in the url works for paging. I just need the links to show up. <?php /** * @package WordPress * @...
0
votes
0answers
829 views

Sort users by custom user meta value

I'm trying to sort users by a custom meta value "user_business" which is their business name that way when users are listed they're sorted alphabetically by their business name as they should be. I'm ...