1
vote
2answers
54 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 ...
0
votes
2answers
34 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
1answer
110 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 ...
1
vote
1answer
219 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
63 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
1answer
301 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 ...
0
votes
2answers
318 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
153 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
2answers
315 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 ...
0
votes
1answer
157 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
1k 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 ...
0
votes
1answer
2k views

Return all users with a specific meta key

I'd like to use get_users() to return all users that have a particular meta_key, but I don't want to specify what the value has to be because it will change for every user. The value is a json string. ...
-2
votes
1answer
139 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 ...
0
votes
1answer
870 views

get current user not working

I was trying this code to get current user info, but showing nothing. My WordPress version is 3.3.1 <?php wp_get_current_user(); /** * @example Safe usage: $current_user = ...
5
votes
2answers
843 views

get_users is expecting unserialized meta_value

I'm trying to get all users assigned to a custom usermeta. I know that get_users() is supposed to work; however, it doesn't seem to be working. What I have is a usermeta storing a category ID and I'm ...
1
vote
1answer
4k 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 ...