The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
15 views

Change users.php WP_User_Query

A client has requested to have two kinds of custom user roles, and have those users displayed in an Admin Menu Page of its own. So far, I've achieved that using WP_List_Table with success. Now, the ...
0
votes
1answer
48 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
0answers
13 views

Update user meta when user login

I have created a custom field last login time, i want to fill it with last time user login date and time. function fb_add_custom_user_profile_fields( $user ) { ?> <h3><?php _e('User ...
0
votes
1answer
27 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', ...
1
vote
0answers
24 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( ...
0
votes
1answer
27 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
0answers
71 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' => ...
1
vote
1answer
42 views

Basic Wp_user_query not finding any users

For some reason, the most basic wordpress user query i got from this generator https://generatewp.com/wp_user_query/ is displaying that it has not found any users $args = array ( ); // ...
0
votes
0answers
28 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' ) ); ...
3
votes
1answer
50 views

User appears twice in a WP_User_Query

For some reason during a user query with a meta filter I have a user who when I print_r the results appears twice in the list... I have checked the database, just in case there seemed to be duplicate ...
0
votes
1answer
42 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
0answers
70 views

Use WP_User_Query to search email and meta data?

I'm trying to do a search for an email and return a bunch of fields only if the user_meta field 'ref' is equal to '32721d22'.Also if the search field is not submitted I want to just return all users ...
0
votes
0answers
32 views

share wp-users between two database

I have a question. I searched many times but could not find any way to do that. I installed a wordpress in domain.com with database1. And installed a new wordpress in a SubFolder ...
0
votes
1answer
185 views

How to fetch WP_User_Query with multiple role arguments [duplicate]

I have two user role 1) vendor 2)freevendor Here i am trying to fetch user by there user role vendor and freevendor with the bellow code but query is fetching only freevendor. $vendor_total_args ...
0
votes
0answers
34 views

WP_User_Query from meta_key and orderby secondary meta_key

I have this code, which works as intended, but now I want to order these by another meta_key. I've tried using meta_query to get another key into the mix, but am still unsuccessful. I want to get all ...
1
vote
0answers
25 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
112 views

How to add custom query filters in WP_User_Query

I am creating a list of all users in wordpress. For that I am using WP_User_Query with meta_query so that I can show only filtered users. I am stuck where I want to add a custom query filters in ...
0
votes
1answer
71 views

How to put an array in wp user query

I am quite new to php and wordpress developement, and I am also new to this website. I want to learn development by trial and error. Please forgive me if i don't use all proper terminology. I have ...
0
votes
0answers
166 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
84 views

External SQL Database (Login Details) to update wp_users with new users

I have an external database which currently has a Username and Password field, which are plain text (password field not using any hashing). Is it possible for when I update this database that it will ...
0
votes
1answer
149 views

WP User Query get all authors with last name starting with specific letter

I need to program a page to which I pass an initial through the url and it will show all author users whose last name starts with that letter. I would like to do this via WP User Query so that I can ...
2
votes
1answer
471 views

Query users by custom taxonomy and user role

I'm trying to make a query for users using WP_User_Query() I need to filter users by role shop_manager and custom taxonomy called shop-category and current taxonomy term ID. The code I have so far: ...
1
vote
1answer
64 views

Complex WP_User_Query call fails on production server

I'm having a very specific and hard to debug problem with a complex meta_query in a WP_User_Query call: I'm using this (simplified) code to built the query: // custom user role $arguments = array( ...
0
votes
0answers
106 views

extract shortcode_atts with multiple meta key and meta value

I am trying to extract( shortcode_atts( array( arry with multiple meta key and value in bellow snippet code you can see that i am extracting shortcode_ats with bellow code ...
2
votes
1answer
116 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. ...
0
votes
1answer
261 views

Extend WP_User_Query or WP_User to return all custom fields?

I'm trying to pull out list of about 5000+ member records for CSV export. The query is timed out and I suppose the reason is that in order to populate the CSV file I need to iterate over those 5000 ...
2
votes
1answer
215 views

WP User Query with search columns and meta query

I'm trying to build a query with WP User Query where it's possible to search after user_email user_nicename first_name last_name This are my args: $args = array( 'role' ...
3
votes
2answers
134 views

What is the most efficient way to search users by their display name?

Initially I thought I'd use get_users() but it turned out it doesn't support the display_name field. Then I've read about using WP_User_Query, but when I do it always exhausts the allowed memory size ...
0
votes
1answer
213 views

WP_User_Query Filter Results

I'm struggling to apply some filters to WP_User_Query, I have the following query, followed by some filters also shown, when I apply the filters they appear within the url structure, so /?gender=Male ...
1
vote
0answers
27 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 ...
2
votes
2answers
129 views

Get Y random authors' ID/Object with more than X number of posts

I want to display Y number of authors' info randomly. These authors have to have at least X numbers of posts published. Please keep in mind that this would be for a blog with thousands of users where ...
0
votes
1answer
92 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
805 views

pre_user_query meta_query admin user list

I'm attempting to use pre_user_query' to change the query to include somemeta_query` variables. My goal is to only display users in the user list if they share a common meta_value with the current ...
0
votes
2answers
245 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 - ...
2
votes
1answer
125 views

How to customize user search

I'm developing a custom user search and I'm using this plugin found here: <?php function sul_user_listing($atts, $content = null) { global $post; extract(shortcode_atts(array( ...
0
votes
1answer
103 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
41 views

How to activate the user search

I'm trying to activate the user search in my wordpress site. Which means that I want also the users on the search result. I have tried some plugins, but none of these gives the solution I want. Is ...
2
votes
1answer
1k views

Searching user meta using WP_User_Query

Per the documentation for WP_User_Query, there is an available search parameter. It looks something like this: $users = new WP_User_Query(array( 'search' => 'This is my search' )); You can ...
0
votes
1answer
152 views

WP_User_Query orderby meta_val_num

I know that normal WP_Query's can have an "orderby" parameter of "meta_value_num", but when I try to user "orderby" => "meta_value_num" on a WP_User_Query, it doesn't seem to work. Anyway I can ...
0
votes
1answer
48 views

custom post type 'pre_[cpt]_query' hook

When quering the wordpress users table, is it possible to use 'pre_user_query' to ammend the SQL query before execution against the database. Is there an equivalent hook method for each registered ...
0
votes
1answer
144 views

Display Users from two roles in one list

I asked a question a few days ago (link) about a problem I encountered with WP 4.1 and a WP_User_Query I ran with a custom meta array. My current code worked until I upgraded to 4.1: if( ...
2
votes
1answer
212 views

WP_User_Query users by registered date

I'm trying to get the number of user who registered today. I've tried this: $args = array ( 'role' => 'Subscriber', 'meta_query' => array( array( 'key' => ...
1
vote
1answer
571 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', ...
0
votes
1answer
175 views

WP_User_Query unexpected output after upgrading toWordpress 4.0.1

I have updated my Wordpress to the new version 4.0.1 and I got some problems. Before I had an old version, the 3.5.1 and everything was ok with my code. Pardon me for my bad english, I try to explain ...
0
votes
1answer
144 views

How do I sort a WP_USER_QUERY by multiple meta fields?

I've got the following WP_USER_QUERY in WordPress: $args = array( 'orderby'=>'meta_value', 'meta_query' => array ( 0 => array( 'key' => 'last_name', ...
2
votes
2answers
350 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, ...
0
votes
2answers
453 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( ...
1
vote
1answer
1k views

WP_User_Query with combined meta query - not working?

I'm trying to use WP_User_Query class to list all users basing on their specific meta fields. When I use simple single-meta query, it works fine: $q = new WP_User_Query( array( 'role' => ...
3
votes
2answers
1k 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
2answers
894 views

WP_User_Query order by meta_key that is an array

I have set a user metadata named achievements which is an array containing various numeric values. Using WP_User_Query, I want to order the list by a specific key within this array named points. The ...