Wrapper for WP_User_Query. Retrieves an array of users matching specific criteria.

learn more… | top users | synonyms

3
votes
2answers
1k views

Sort get_users by custom field

I have a custom USER taxonomy called 'label' which also has a custom field of 'sort_order' - I am trying to return a list of users that have the label taxonomy and then sort this list by the ...
0
votes
2answers
237 views

get_users with Serialized Custom Meta Value

I'm attempting to use get_users to select users with only a certain meta value. In this case the meta key is extraInfo but the the values are in a serialized array. Can I pull users out like this? ...
0
votes
2answers
173 views

Get current user outside of Wordpress Multisite

How to get current logged in user in Wordpress Multisite outside of it? I tried the method for Wordpress Singlesite and it give the error Call to a member function set_prefix() on a non-object on ...
1
vote
1answer
47 views

Do not execute If User is login as Administrator or any Specific Role

How can I not execute some <script> </script> if the user is an administrator or any specific role? Basically I need to do something like this: <?php if( !User( 'Administrator', '...
0
votes
1answer
31 views

Every time I use wp_get_current_user() my plugin breaks

I have been trying to make a sign-out plugin that allows users to sign out from military training activities that they should be at. After they fill out a form explaining why they are not going to be ...
0
votes
1answer
37 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
59 views

I try to add informations to User profile

I try to add information fields to User profile. But my code doesn't run! :-( In functions.php I add: function add_contact_profile($user_contact) { $user_contact['twitter'] = __('URL Twitter'); ...
0
votes
1answer
176 views

Wordpress /users/me endpoint request forbidden

Using Wordpress's plugin WP REST API version 1, there is an endpoint called /users/me which response with data for the currently logged-in user. When I requested /users/me I got 403 Request Forbidden ...
0
votes
1answer
81 views

How to List only the users created by a particular user

How can I list only the users created by any particular logged in user. Suppose,I'm a Subscriber and there are users already registered, I then added User1(as Associate), User2(as Subscriber). When I ...
0
votes
1answer
357 views

get_users() ORDER BY Not Working

I'm not sure where the problem lies, but the code below just doesn't have the effect of ordering by ID in descending order. $args['role'] = 'subscriber'; $args['orderby'] = 'ID'; $args['order'] = '...
0
votes
1answer
253 views

Order users by number of posts (includes custom post type)

I am using the function below to count posts for users (including custom post types). I am putting together a list of users and want to order them by this count function. The orderby options for the ...
0
votes
1answer
141 views

Update user from external script

I am using the API code of WordPress to update some fields of user profiles but I am having some problems. When I try to save information, it is not updating unless I click twice. For example for ...
0
votes
1answer
302 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 ...
-2
votes
1answer
155 views

Get all user with both meta_value

I was wondering if there were any efficient way of fetching all user comparing two different meta_key. I am currently fetching all user compared to the first meta, then loop trough the user_id to ...
1
vote
0answers
49 views

How to get Role Subscribe Users on Admin Menu only in Pages in Wordpress

How to get Role Subscribe Users on Admin Menu only in Pages in Wordpress and also asign pages to only a specific user and also get the pages on homepage by user ID. Example: here a link, i want to ...
0
votes
0answers
31 views

Filter User Query

I am using the code below to display all of my users on the front end. <?php $args = array( 'meta_key' => 'last_name', 'orderby' => 'meta_value', 'order' => 'ASC', '...
0
votes
0answers
74 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
15 views

Custom search for users

I've coded this up and it works great to search for "John" as a wildcard: $your_search_string = 'John'; $user_list = new WP_User_Query( array( 'search' => '*'.esc_attr( $...
0
votes
0answers
17 views

track logged in user link/clicks

I'm stumped here. I'm trying to track specific links on my site and report back time stamp of when a user clicked that link. These are for specific downloads and only registered users can access the ...
0
votes
0answers
161 views

Get_users doesn't return all wp user data fields after search

I want to get all wordpress users which have some string in their user_login. I use get_users with search parameter but it return only id in WP_User->data. I need all data fields (user_login, ...
0
votes
0answers
51 views

How to get the list of users logged in to wordpress and expose it in JSON?

Is there a way to get the list of users logged in to wordpress site and expose it in JSON? Please throw some lights to achieve this.
0
votes
0answers
70 views

Custom Rewrite for Profiles

I'm currently trying to modify my rewrites to allow for an additional URL segment e.g. http://example.com/vendors/username/ by default WP allows for additional numeric segments but everything else ...