User meta data consists of key-value pairs pertaining to the according user ID.

learn more… | top users | synonyms (2)

-1
votes
0answers
5 views

how to get specific fields from get_user_meta()

I use $data = get_user_meta ( $user_id); to get all data. But only need some fields like gender - city - answer. How can I filter this in get_user_meta()?
0
votes
1answer
5 views

Require confirmation of current user's email before updating database and before send_email_change_email

I like the core ability for users to update their default "Email" field. For example username1 can edit their own profile and change their "Email" field from email1@example.com to email2@example.com ...
0
votes
1answer
597 views

Help integrating Custom post type meta field with custom profile fields

I have a custom post type for "locations" and I need to have "users" log in and be able to pick a location that is within a certain distance from them. I have added some spots to the profile using ...
0
votes
1answer
27 views

how to get list of all users + there metadata

How do I get a list of all users with role = 'Customers' including all the metadata per user, means wp_users + wp_usermeta. Query below does not generate the wanted results. $query = "SELECT * ...
1
vote
0answers
421 views

SQL query equivalent to WP User Query

I have the following WP user query code: //Get all users sorted by whatever $sorted_users = new WP_User_Query(array( 'orderby' => 'meta_value', 'meta_key' => 'satisfaction_rating', '...
0
votes
2answers
613 views

How to add follow functionality to multi-author wordpress site?

is there any way to add "follow" functionality to Wordpress ? so that every logged-in user can follow his favorite author and only can see post from authors that he followed them .. A possible ...
1
vote
0answers
17 views

Redirecting users based on custom user meta

I am novice trying to use the following code: function my_login_redirect( $url, $request, $user ){ if( $user && is_object( $user ) && is_a( $user, 'WP_User' ) ) { if( 'cool' == ...
-2
votes
0answers
26 views

How to show all usermeta values of specific key as dropdown

I have created a custom usermeta field in the user profile named key user_designation. How can I show all its values as a dropdown?
0
votes
1answer
50 views

Show global Message in User Profiles with admin only Input field in Wordpress Backend

I try to display a piece of text (without plugin) for example "Quote of the day: Some text" on all user profile pages (.../wp-admin/profile.php). This Text should managable/editable from the Profile ...
0
votes
1answer
22 views

wordpress meta value compare between two date

I want to check date between two year of birth. But my saved value is date of birth. Meta key "birth_date". Now I want to check value between years using year. My saved date format like "01/01/1995" ...
3
votes
1answer
55 views

Hide a user from WordPress

I'm using the below code to hide a user from the WordPress User List: add_action( 'pre_user_query', 'ap_pre_user_query' ); function ap_pre_user_query( $user_search ) { $user = wp_get_current_user(...
5
votes
2answers
259 views

Content hooks vs User hooks

This is more of a theory question than a question with a direct answer. I've been working with different actions for firing functions when a post is updated or deleted and when users are updated or ...
0
votes
2answers
30 views

Customizing WP tables or adding new ones?

I would like to extend user data, adding picture, department, phone, etc. You may achieve this adding custom fields to the usermeta, however I wonder if this techniques is deprecated and it would be ...
1
vote
1answer
168 views

Update user meta using with ajax

I want to edit user meta on the front using an ajax form, this is what i have: The form has the user ID: <form id="<?php echo $current_user->ID; ?>"... This is the script:: <script&...
3
votes
1answer
1k views

WordPress last login foreach user

Trying to get the last login of each user and display it into the admin panel. Currently I can display the first user within the admin loop, however I can't pull out the remaining users. I think I ...
6
votes
1answer
191 views

Create custom user role (client) that can create another custom user role (employee) of that client

Bit of a long question, but I do believe this situation will occur for other people in other contexts. Our company needs to create an Employee Assistance Program MU subdirectory network site where ...
0
votes
0answers
22 views

get selected Option value in Dropdown selection

I want to store some Custom User Meta in Edit User Form. i but i cant get it working :/ Here is the following code add_action('show_user_profile', 'add_extra_berufe'); add_action('...
0
votes
1answer
15 views

Order By Meta_key but convert custom date to Y-m-d first

So I have a meta key called sermon_date. Without having to change the custom post type format for Y-m-d and then editing all of the sermons to have that date....they are in m-d-Y format currently. So ...
1
vote
1answer
27 views

User Last Login Sort Column

I've seen there are several ways to display a user's last login date on the Users page without having to use a 3rd party plugin. Building on that, I'd really like to have the user's last login date ...
-1
votes
0answers
14 views

update user meta in admin

I need to show user meta at user detail in admin panel so i add below script to end of functions.php in theme directory add_action( 'show_user_profile', 'display_user_detail_user_meta' ); add_action(...
2
votes
0answers
35 views

Where to Store Custom User Fields

I've built an enterprise Wordpress site and we are currently designing an automated import of company user data directly into the Wordpress database, so it's not manual. This user data has more data ...
1
vote
2answers
652 views

Update user meta of author when post content is viewed

I have a value that I'm trying to store as user meta for authors on my site. I need it to update itself every time the content of a post is viewed for that author. Here's as far as I've gotten but it ...
7
votes
2answers
130 views

Difference between update_user_meta and update_user_option

Can anyone explain what is the difference between update_user_meta and update_user_option and in which scenarios the both can be used?
0
votes
1answer
30 views

How to display checkbox meta array values one by one?

By wp user frontend I add some checkboxes to users frontend profile. When I use echo get_the_author_meta('my_pet', $author_id) output is: cat| dog| hamster And when I use this loop code $pet = ...
0
votes
0answers
25 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
0answers
16 views

same users different websites other then wordpress

I am creating a network of sites. I have some wordpress installations as well as some other scripts installations. I know that i can use single wordpress users table for different wordpress ...
1
vote
1answer
414 views

Exclude main blog from get_blogs_of_user

I use WordPress Multisite and in the sidebar i have a box that shows a list of blogs the logged in user is a member of. I'm looking for a way to exclude the mainblog from this list. The main blog ID ...
0
votes
1answer
26 views

query post by author gender

I'm using utimate member plugin on my website. for each member (author), I have a field to store the member gender. (Homme / Femme). the data is stored in my database, inside wp_usermeta. meta key ...
0
votes
0answers
33 views

Show list users based on two custom field values

I'm kinda stuc. I have added an extra field in the user profile for my authors, called ArtistCategory which can be Tattoo or Piercing. I'm using this key and value to filter for menu and gallery ...
1
vote
0answers
24 views

Allow role to edit users at lower level with only specific metadata

How to allow a custom role, company-administrator, to be able to edit/create/delete users lower than their level, subscriber, where some metadata is matched? To elaborate: I'm making a membership ...
0
votes
2answers
178 views

Gather posts into a cart/lightbox and share with another user

Ok I've almost completed a Wordpress site that is a multi-user Image Library. This is a private site, where users must be logged-in to view it. The average user cannot get to the backend (wp-admin) ...
0
votes
1answer
29 views

The Simple and Correct Way to Add User Meta

I want to give points to users to their activities like writing posts, writing comments, etc. I thought to use user meta to store points. I know that I can use add_user_meta... But the problem ...
0
votes
2answers
565 views

duplicate user metadata key values

I've spotted that some of my users have duplicate metadata key values (my only fault because i inserted data directly to the wp_usermeta table!). This query for example SELECT * FROM `wp_usermeta` ...
0
votes
0answers
99 views

How to show twitter link preview (Card View)

I want to ask about my problem. I can't show twitter link preview for my website and for information, I just add this code i get from WP Beginners <?php #twitter cards hack if(is_single() |...
4
votes
2answers
49 views

Building a scalable Wordpress favouriting plugin - one serialised meta value array or many meta records

I am trying to build a simple Wordpress favourite post plugin that is scalable and could handle 1000s or 10000s of users or more. There are several different approaches that I have seen in other ...
0
votes
1answer
26 views

Getting a users username in get_user_meta

I am getting people's first and last names this way: $_UFName = get_user_meta($_uid, 'first_name', true); $_ULName = get_user_meta($_uid, 'last_name', true); where $_uid is the persons id I ...
0
votes
1answer
21 views

Users are required to login to my site. How define user.member boolean, its permissions, and conditionally display/handle behavior based on it

Users are required to login to my site. They are redirected to the login page and not allowed past the login page until they authenticate. Once authenticated, they can access most of the website. ...
0
votes
1answer
60 views

Save buddypress xprofile data to author meta

I have created a buddypress extended profile field "description" and would like to save the data entered to the "descripion" profile field of the user (DEfault wordpress Biography description field) ...
0
votes
3answers
81 views

Updating user meta on save post

I have a custom post type called 'programmes' that details seminar information. Using a form visitors to the site can signup to a specific 'programme', once they have completed the form a new user is ...
0
votes
2answers
2k views

Plugin that would allow WordPress Authors to “follow” other Authors and query “Activity Info” from that

I have a WordPress blog that is all user based Authors that submit content and such. Currently in the site, you can view other authors profiles but basically just view their content from the author....
0
votes
1answer
42 views

How to add custom detail page for a Subscriber at Admin Panel

I have created a custom page which shows the list of Users(Role = 'Subscriber'). I named this page "Reporting" & It is based on wp_list_table. Now I want to show the user details (having custom ...
1
vote
0answers
48 views

Customize Avatar using user meta

I have a customer where all the users are synchronized through an API every night. This API gives me the profile picture for each user and it is stored as a user meta with meta_key = 'image'. Is ...
0
votes
1answer
26 views

Creating multiple profiles under one user to assign to particular posts

I am working with WP Job Manager at the moment quite a lot and currently on each job you would like to post you enter a set of details about the company the job is with. This info is then echoed out ...
0
votes
1answer
36 views

UserMeta Changes Meta Value for Post ID

I am building a proprietary LMS(learning management system), and am attempting to add a simple bookmarking function that saves the $post->ID for the last page visited within my "course" CPT(custom ...
0
votes
0answers
66 views

ACF - Update User Meta Checkbox Values

I am using ACF and I have extended the user profile so it includes additional textboxes and checkbox values. On the frontend the user can update their user profile which is working as follows:- <...
3
votes
1answer
59 views

Can I count the number of users matching a value in a multiple value key?

I'm trying to find the number of users having a certain value in a custom field. The problem is that this custom field allow multiple values. This code works well when the meta_key allows only one ...
2
votes
1answer
43 views

How to query users by meta value, even when meta key doesn't exist?

The problem is that users for whom votes_total doesn't exist are getting skipped. See below: $args = array( 'meta_query' => array( 'relation' => 'OR', array( ...
3
votes
4answers
1k views

How to filter users on admin users page by custom meta field?

The Problem WP appears to remove the value of my query variable before it gets used to filter the list of users. My Code This function adds a custom column to my Users table on /wp-admin/users.php: ...
0
votes
0answers
19 views

wordpress query between zipcodes not working

Ok, I have this code that checks for zipcodes in the database, normally I can simply do a between query, but the zipcodes are stored in the following way: zip_code::2025 (meta_value in the usermeta ...
0
votes
0answers
20 views

Add wordpress category id to user meta with button

I want to know which categories my users are most interested in so I want to add a button to categories theme so if they click it that is saved to user meta. Similar to this: Let user subscribe to ...