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

learn more… | top users | synonyms (2)

0
votes
0answers
2 views

How to update_user_meta with a variable?

I have added a field COMBINED_WORKSHOPS to the User Profile: add_action( 'show_user_profile', 'add_attendance_to_profile' ); add_action( 'edit_user_profile', 'add_attendance_to_profile' ) function ...
0
votes
0answers
8 views

Merge multiple user meta values into a single value?

I have an event website, and whenever a user attends an event, I pull that event into their user profile. What I currently have is a table of attended events with details (event name, date, hours, ...
0
votes
0answers
64 views

Limit the number of successful logins

I would like to retrieve the number of successful logins of a user and act accordingly. If user logged in more than 10 times, then log out user automatically with wp_logout() or similar. I would ...
0
votes
0answers
14 views

How can I detect if user has subscribed Memberpress product already

How can I detect if user has already bought a memberpress product. I'm searching something like this: if(have_subscription){ //code to add button }else{ // code to add something else } I have no ...
0
votes
1answer
9 views

User biographical information erased on login

When any user logs into my Wordpress install, it deletes their biographical information for some reason. I know this by watching the value of a query similar to select*from wp_usermeta where ...
0
votes
1answer
26 views

Get an array of meta_values for a user meta_key

I need to get an array of all the meta_values for a user meta_key. I found this code: $cities = $wpdb->get_col("SELECT meta_value FROM $wpdb->usermeta WHERE meta_key = 'my_cities_meta_key'" ); ...
0
votes
1answer
33 views

List users by meta_key and meta_value

The following function will display a list of users based on their meta data: <?php function get_users_by_meta_data( $meta_key, $meta_value ) { $user_query = new WP_User_Query( array( ...
0
votes
1answer
24 views

How to add an attribute to a user?

I have looked for an answer, and couldn't find a clear and relevant answer yet. I want to add more attribute to the users not to display, but only store information about them. The information will ...
0
votes
1answer
42 views

How to save multiple options from a dropdown in user profile

I use this code to create the dropdown and then save the dropdown chosen values: <?php // Display Fields add_action( 'show_user_profile', 'add_multiple_choice_dropdown ' ); add_action( ...
0
votes
2answers
27 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 - ...
0
votes
1answer
22 views

add_post_meta | update_post_meta | Via the frontend

I am having a difficult time trying to figure out how to save user meta data to a post. The goal that I am trying to accomplish is this, have a user make a selection from a drop down list, and save ...
0
votes
0answers
27 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
13 views

How do i put in user id in a banner

I would like to know how im gonna put in a user id in a banner. For example. I have 5 logged in persons on my page, and 3 of them has clicked on the same banner, but I need to know who is clicking. ...
0
votes
1answer
29 views

Update user meta without lose of old data

Is this is possible to update the user meta without lose the old data it have ? For example : i have the following data in my user meta field name user_documents ...
0
votes
1answer
47 views

How to delete only user meta value (not key) from usermeta table in wordpress?

I store multiple image in media library and save its id in wp_usermeta table. my metakey is 'images' and meta value in like '279,280,281'. Now I get the image from table like this: <?php $images = ...
0
votes
1answer
29 views

Multiple meta values for one meta key

I have one meta key "game" containing this meta value "game 1, game 2". I would like to display this meta value on my site like this: <a href="http://www.url.com/game-1">game 1</a> <a ...
0
votes
1answer
27 views

Plugin will sort users by usermeta

As I refine my most popular plugin it will store a special number decoded from the user's birth date, which is an extended BuddyPress field in bp_xprofile_data. All users get a number between 1 and ...
0
votes
0answers
36 views

Display Users by usermeta using foreach loop with multiple relationships

I'm getting a real headache trying to sort this one out. Here's my problem: I'm working on a feature for a site that requires Users to be displayed according to their association with a common ...
0
votes
1answer
78 views

generate unique number when registering a user

I know there are userID, username in the database, but I want a formatted and unique number for physical world use. For example: "2014xxxx" 201414:year,xxxx:generate randomly when registering a user. ...
1
vote
1answer
26 views

When is a user's meta data table loaded?

Exactly when is a user's meta data loaded? I'm using many get_user_meta() calls for the current user. If all of a logged in user's meta data is loaded anyway, then this type of call is not a problem.
0
votes
1answer
47 views

Function that prevents users from uploading photos more photos

Mjello, I'm struggling with this function that prevents users from uploading more photos than what their membership are entitled to. So they have 10 photos to upload. When they've reached 0 they ...
0
votes
1answer
46 views

User list order by user meta

i have created user vote that can vote users or author of posts. so for example have 4 users which looks: user --- ID=1 --- META KEY='_thumbs_rating_up' --- META VALUE='13' user --- ID=2 --- META ...
0
votes
0answers
20 views

Custom Post Type with /%shop_name%/gallery/%gallery% permastruct?

I have created a custom user meta = shop_name in User Profile and custom post type gallery I want my permalink to be in form of /%shop_name%/gallery/%gallery%. Every user has a custom user_meta = ...
1
vote
1answer
104 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
0answers
98 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
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
144 views

Get all user meta by meta key instead of ID

I'm trying to compare user meta values to find highest and lowest values. I have a user meta value set up called "hourly_rate". I want to get the hourly rate for all users and then run PHP's min() and ...
0
votes
2answers
58 views

Create reviews and star-rating for user accounts in wp-admin [closed]

I would like each and every user to have the rating in stars and a review along with it so that any user can rate them using JavaScript 5 stars. The various reviews along with stars rating should be ...
0
votes
0answers
12 views

MySQL Trigger Help

I followed this question's answer to make my multiple wp installations to use a single user database, I want this: to happen every-time a new user registers. Can someone teach me how to make a ...
6
votes
3answers
154 views

Capabilities Vs User Meta

What is the advantage of using capabilities instead of usermeta? For example a cap access_feature_x vs meta access_feature_x. I can use current_user_can() vs get_user_meta() on various checks. ...
0
votes
0answers
27 views

Would like to add a “leaderboard” (custom field) to a custom post type

I've made a custom post type called a "Workout" that has an associated "leaderboard" just some text that has the top scores for the day. I'm trying to flush out the following use case: In the ...
0
votes
0answers
22 views

Custom User Authentication using Meta Data

I have inserted two custom fields called user_login_status and activation_code in wp_usermeta table. My code on login page function dlf_auth( $username, $password ) { global $user; ...
0
votes
1answer
20 views

Fetch User Meta Data

Table - wp_usermeta user_id meta_key meta_value 10 login_status 0 10 active_code 3f7431e226893f16cbe44424850d00ad I need to select user_id where login_status = 0 and ...
5
votes
1answer
142 views

Automatically delete inactive users after 2 months

I am trying to modify this function: // automatically delete users after 7 days in wordpress function wcs_auto_delete_users() { global $wpdb; $query = $wpdb->prepare( "SELECT ID FROM ...
2
votes
2answers
49 views

SQL to check how many sites a user is a member of

I have a multisite installation and I'm working on creating a reporting plugin. One of the things that I would like to do is show the number of sites a user is a member of. Right now, I'm using ...
1
vote
1answer
256 views

How to add country drop down menu to the user profile?

I've added this code snippet to my functions.php function my_new_contactmethods( $contactmethods ) { $contactmethods['country'] = 'country'; return $contactmethods; } ...
0
votes
1answer
53 views

Populate a select box with data stored in the database?

I know generally how to add custom fields to the user profile page. However, I need to add a custom select box to the profile page that is populated with all the schools in the state. (Our users will ...
0
votes
0answers
14 views

when update user_nicename ,Englishi work well,but Chine will be empty

I builted a form to update user's profile. all fields worked ,but if I input something in Chinese,fileds will be empty,Code is blow: /* Update user nicename. */ if ( !empty( $_POST['nicename'] ) ){ ...
0
votes
0answers
11 views

Why all contributor that have post not have page

I have problem when moved from drupal to wordpress. Now i have user in contributor that have post in my site. This user cannot see his post in my site in homepage. To solved it i convert him to ...
0
votes
1answer
34 views

How To Get User Data in Callback Function for pre_user_nicename?

Whenever I update a user profile in the dashboard, the user nice-name gets changed in the database: Every time, a "-2" is added. I tried to reset the nicename (based loosely on this thread) by ...
1
vote
1answer
55 views

Is this code true or not

I am a beginner in coding but i have just wrote this code , The concept of code is : The code adds a form with a button to each user profile. The button is captioned as Follow/ Unfollow. It updates ...
0
votes
1answer
43 views

How can i create an array user meta?

I want to create a new user meta that contains array content How can i do this ? Another question : is it true using this code to check if the array user meta exists before creating it ? <?php ...
0
votes
1answer
84 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
votes
1answer
111 views

How To Display Author Photo In WordPress without any plugin?

How To Display Author Photo In WordPress without any plugin? I know there are many plugins in wordpress that give me solution. But I don't want to use any plugin. Is there any way to add image for a ...
0
votes
2answers
151 views

Get currentuserinfo firstname and lastname

I am trying to insert the user firstname and last name into the database whilst processing a woocommerce order. I have managed to get two empty fields into the database where I need them however i am ...
0
votes
1answer
61 views

Exclude specific user_id from args in get_comments

I'm basically using a 'latest comments' system on multiple pages where one specific user is listed as the first reply for a comment - highlighted with special CSS - and then 2-3 normal users below ...
0
votes
1answer
71 views

Adding fields to the “Add New User” but the form data not saved into DB

i have add new fields when we create new user in user-new.php the new field appears in the form, but the form data not saved into DB. after i created new user, i go to "edit user" and see the field ...
0
votes
1answer
55 views

WPML Default Language User Meta [closed]

I'm having a super hard time finding the names of the default user meta that's included with WPML. WPML has a setting for "Default Admin Language" under every user's profile. I'd like to access this ...
0
votes
0answers
30 views

Include new meta_data in WP_User_Query

I'm trying to add a new meta field to the results that come from Wp_User_Query. Not keen to use get_user_meta() in a loop for each user returned as I believe that it'll make hundreds of database ...
0
votes
2answers
74 views

What is the most efficient way of implementing a notification system? [closed]

I am about to start implementing a notification system for my site and would like to know what performance measures I need to take into account before developing it. I need to make this for a large ...