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

learn more… | top users | synonyms (2)

0
votes
1answer
13 views

How to get users by a custom field / by user meta data?

I've added a custom field to users profile using the following code: /*** Adding extra field to get the the user who creates the another user during ADD NEW USER ***/ <?php function ...
0
votes
0answers
17 views

View Gravity Forms data on a users papge

I am a newb to the CMS world. I decided to use Wordpress along with Gravity Forms to build a website. I'm using Gravity Forms along with the User registration add-on to gather the data I require, ...
0
votes
0answers
17 views

How can I programmatically show a specific (template) page, like author.php?

My current, hacky way, is this: Right now, in my functions.php file I have something like this: /** * Create the query var so that WP catches the custom /profile/username url */ function ...
1
vote
0answers
36 views

Extending WP_User class and using this sub-class during the whole lifecycle

I am currently struggling with this software design issue I can't seem to get hold of. What I am trying to achieve is the following: for every user on our website, I want to do an API request to a ...
0
votes
0answers
21 views

When to hook into edit profile action?

I have the following function which combines the values of a few user profile fields and saves them as a new user_meta called COMBINED_WORKSHOPS. The function works, but I don't know when/where to ...
0
votes
0answers
70 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
16 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
10 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
39 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
38 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
26 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
72 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
30 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
39 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
32 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
41 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
65 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
41 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
30 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
56 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
132 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
30 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
59 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
67 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
163 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
125 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
68 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
210 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
71 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
14 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
169 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
30 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
25 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
25 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 ...
6
votes
1answer
174 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
50 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
333 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
66 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
16 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
13 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
41 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
57 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
45 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
100 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
152 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
188 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
66 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
77 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 ...