The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
49 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
1answer
44 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 ...
0
votes
1answer
30 views

Iterate through users and display users meta info at front-page

I have a meta field in user called columnista-destacado I need to iterate through Wordpress users and if that field has valued set (lets said equal 1) then I need to display user meta info at ...
0
votes
1answer
35 views

How to set custom upload directory per user after moving content directory

I set the content and the wordpress directory of wordpress like described in the codex: define('WP_SITEURL', 'https://' . $_SERVER['SERVER_NAME'] . '/wordpress'); define('WP_CONTENT_DIR', ...
0
votes
1answer
46 views

List of users with email and role

I'm looking to create a list of all the users on my wordpress site with their email and role. $blogusers = get_users(); // Array of WP_User objects. foreach ( $blogusers as $user ) { echo ...
1
vote
3answers
540 views

How to check if a user exists by a given id

Is there any way to check if a user id exists? I want to create a function similar to username_exists() but which returns if the id exists or not.
1
vote
2answers
165 views

Select Multiple meta_value from WP DB; Single Query

I am trying to retrieve each user's first and last name, phone, email, and address from the usermeta table. I'm having trouble selecting multiple meta_values, each with its own meta_key, using a ...
3
votes
2answers
261 views

Display list of users who have made at least 1 post

What I would like to do is have a list of users who have contributed at least one post. I need to show the following: [User photo] | [User Name] | [User post count] e.g. [photo] Joe Bloggs(8) I ...
0
votes
0answers
23 views

Logging in user automatically from non-WP ASP.net site?

At the time I was brought in, the client had a fully WP site and I had specific tasks to built surveys and reporting available only to logged in users. Since completion, the client's other developers ...
0
votes
2answers
94 views

Is a user_meta research case-sensitive or not

I am using the Wordpress get_users() function to search for users with a specific meta_key value. $wordpress_user = get_users( array('meta_key' => 'unique_id', ...
0
votes
2answers
59 views

Cannot retrieve active members only

Below is a page template where I'm trying to retrieve active members metadata (of Restrict Content Pro). Displaying users' meta is working just fine; but I can't get ONLY active members to display, ...
0
votes
1answer
229 views

Get author meta of all writers

We know from the docs that you can get an author's meta like so: <?php get_the_author_meta( $field, $userID ); ?> But I would like to have a custom "About us" page which displays all the ...
0
votes
1answer
54 views

Wordpress where clauses in db select

I'm currently struggling with implementing a feature for wordpress site. I would like to get the count of all users which have the key pending_approval='true' and is_photographer='true' (located in ...
0
votes
2answers
353 views

Order get_users() by last login date. Is it possible?

I want to create a page that displays all the blog users ordered by the last login date. I've tried with the get_users() function and I can succesfully get the users' list, but not in the order I ...
1
vote
2answers
161 views

Displaying a random user with a shortcode

I'm trying to setup a shortcode to show a single random user each time the page is refreshed. I've been successful in displaying all users or a select user by the user ID. Here is my shortcode as it ...
0
votes
0answers
40 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
1answer
204 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
118 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 ...
1
vote
2answers
521 views

global $current_user not current user

I believe I have a misunderstanding of what the global variable $current_user is exactly. I'm attempting to display the current user's email and name on a page using add_filter('the_content', ...
1
vote
0answers
37 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 ...
2
votes
2answers
319 views

Efficiency on displaying random authors based on large database

I'm trying to display a list of 5 authors randomly. Here are some solutions I had found: http://stackoverflow.com/questions/5502609/get-authors-randomly ...
1
vote
2answers
182 views

Adding tags and inputs to a user's profile

I'm adding a number of items to the user profiles using this method in my functions.php function modify_contact_methods($profile_fields) { // Add new fields $profile_fields['twitter'] = ...
0
votes
1answer
213 views

Query to get last posts from authors of blog

Firstly I get user with role "author". $author_args = array( 'role' => 'author' ); $authors_list = get_users($author_args); Nextly I reform array $author_list = array(); ...
1
vote
1answer
312 views

WP_User_Query pulling ACF to loop

I'm using following code to display my users on template <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $paged -= 1; $limit = 100; $offset = $paged * $limit; $args = ...
0
votes
1answer
101 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 ...
1
vote
2answers
842 views

Get author id from url

I am trying to get the authors user_id on a page linked to by using get_author_posts_url(),. For example http://example.com/author/John%20Smith where John Smith is user_id is 23. I need to get ...
0
votes
1answer
71 views

Randomize Users

I'm trying to randomly display my users and I was wondering if I could edit the answer on this page to suit my needs (multiple users instead of a single user): Sidebar random author spotlight Here's ...
0
votes
0answers
63 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 ...
0
votes
1answer
44 views

how to get the top 10 popular blogs

Our wordpress sites have many many users, each of them have an blog account, they can write posts,comments and so on. Now I want to find out the top 10 popular blogs, according to or order by ...
2
votes
2answers
98 views

Paginate a list of users?

I'm currently displaying a list of all users using the following code. The only problem is that I need to paginate and only display 10 users at a time. I'm familiar with pagination using CPT's and ...
0
votes
1answer
293 views

Can't manage to make translate_user_role() work

I've been looking into wpse archives to solve my problem but I can't manage to do such a thing. I built this code : $args = array('fields' => 'all_with_meta'); $users = get_users($args); foreach ...
0
votes
2answers
64 views

Custom search by several options send on form not works

I am using the Advanced Custom Field Plugin to add custom fields for the users profiles and display a list of users in the frontend of site with Simple User Listing Plugin. I need to filter a list of ...
0
votes
1answer
368 views

Reduce number of SQL queries inside WP_Query loop to fetch author data

This question applies to scale and does not concern typical blog implementations. I'm working on a web app where I'm running standard WP_Query to fetch some custom post types. This usually results in ...
2
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 ...
1
vote
1answer
428 views

Order the users by the date of their latest post

I use the following code for getting the authors of in my multi-author blog and order them by their post count. I want to order them by the date of their last post $authors = ...
1
vote
2answers
338 views

Getting all the users who have author privilege

Can anyone tell me how to get all the users who have author privileges by querying the DB in WordPress and order them by number of posts written by them. I use the following query to get all the ...
0
votes
2answers
385 views

Getting list of top 10 users and sort on last name

I would like to display a list of the top 10 authors based on the amount of posts that they have, and then sort them on last name. To my knowledge, this is not trivial since the last name of a user ...
0
votes
1answer
176 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 ...
5
votes
2answers
711 views

Custom post type support for get_users('orderby=post_count');

The default WordPress function get_users('orderby=post_count'); only orders users with the count of the posts they've made. Any idea how to modify this to support custom post types as well? UPDATE: ...
0
votes
1answer
647 views

Redirect to current user page upon link click

I hope this problem does not have too complicated of a solution. I also hope it isn't too easy so I don't feel like a fool for not figuring it out :) On my website, (Wordpress), I have Peter's ...
3
votes
1answer
537 views

How to display the names of users from a specific group with a shortcode?

I have in the database a table with the user_id and corresponding group_id values, so each row contain the ID of the user that is a member of a group and the related group ID. The question is: How to ...
0
votes
1answer
527 views

Convert usernames listed by the Groups plugin shortcode to displayed names?

I have created a group with the Groups plugin and I want to display the members list of that group. I put the shortcode [groups_group_info group="Group Name Here" show="users"] in a page, but it ...
0
votes
1answer
2k views

get_users meta_query

I can't get meta_queries working correctly on get_users(). For the life of me can't figure out what I'm doing wrong. $args = array( 'meta_query' => array( ...
0
votes
1answer
184 views

get random users each time based on the meta key

I have many users on my website, out of some has status "elite". I am saving this status in meta key/value for each user ('meta_key' => 'elite_member', 'meta_value' => '1'). I want to display ...
1
vote
1answer
368 views

Author List page: Exclude based on last post date

I have a Author page that I built using this code and it works fine. However, I have several writers that range from frequent to one-time writers. I would like to seperate out writers that have not ...
1
vote
2answers
432 views

How may I filter get_users() similarly to pre_get_posts?

I have filtered posts, pages and custom_post_types based on $current_user custom usermeta field values using pre_get_posts(). Is there a similar method/function to alter get_users() based on ...
2
votes
3answers
741 views

Sort users in get_users() in custom order

<?php $blogusers = get_users('include=5,6,2,7,12,8'); foreach ($blogusers as $user) { ... } ?> Right now, these users will sorted by first name. How do I sort this in the order the ...
0
votes
1answer
186 views

Echo text if field under user_meta is empty with get_users()

With get_users() I am listing users and their information. I've a custom field in the database, people_lists_class. <?php $blogusers = get_users('role=contributor&orderby=display_name'); ...
0
votes
2answers
2k views

How to get the user description with get_users?

I'm using this piece of code to list users and their information. The problem I'm having is that the description isn't showing. Obviously it's because the description lays under "user_meta" and not ...
2
votes
1answer
1k views

How to do get_users() with multiple meta_keys

In the codex it says its possible to do get_users() with multiple meta keys by using the meta_query parameter but it doesn't explain how. Can someone give me an example?