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

learn more… | top users | synonyms (2)

0
votes
1answer
14 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
22 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
15 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
13 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 = ...
0
votes
0answers
38 views

Edit, Add or unset woocommerce user meta fields in the admin panel [on hold]

I used the following filters and hooks (add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); add_filter( 'woocommerce_billing_fields' , 'custom_override_billing_fields' ); ...
1
vote
1answer
26 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
38 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
28 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
35 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
34 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
11 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
146 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
19 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
13 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
18 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
99 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
45 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
125 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
31 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
8 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
25 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
54 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
33 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
60 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
52 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
65 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
53 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
63 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
39 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
21 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
62 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 ...
0
votes
0answers
12 views

any way to bind a taxonomy term to o user to just query it afterwards?

I need somehow to add an existing term from an existing taxonomy to a user like a category of users, but not for the purpose of limiting them to posts is that easily possible? I found some plugins ...
0
votes
1answer
43 views

How do I sort a WP_USER_QUERY by multiple meta fields?

I've got the following WP_USER_QUERY in WordPress: $args = array( 'orderby'=>'meta_value', 'meta_query' => array ( 0 => array( 'key' => 'last_name', ...
0
votes
0answers
45 views

restrict_manage_posts for users?

restrict_manage_posts is great for allowing me to filter posts by taxonomy on the admin page. Is there any way of using a similar function for the users admin page - so I can filter by user meta data ...
-1
votes
1answer
49 views

Can't sort custom column on user.php by number / meta_value_num?

Everything else works fine but it's still not sorting by number. Would just like to know what I'm doing wrong here Here's the code function add_user_columns( $defaults ) { ...
0
votes
0answers
50 views

How to toggle delete/update user meta values?

I have multiple forms which stores extra user fields in usermeta table. For this i use foreach($user_meta_fields as $user_meta_field){ If($_POST[$user_meta_field] !=''){ ...
0
votes
0answers
33 views

Paginate User Query

I am trying to write a simple shortcode function that will return a list of users based on a given meta value. It functions fine, but I am trying to paginate the list. Here is my code: function ...
0
votes
1answer
71 views

WP_Editor not saving data in user_meta

I have a front-end plugin which allows users to modify the fields (user_meta) of their profile, and everything works except the wp_editor. <div class=""> <label ...
0
votes
0answers
32 views

Preventing concurrent update of data

I have to implement the update of some metadata. An algorithm try alter some global variables in order to minimize a global error function. This algorithm is triggered by users who ratings each other. ...
0
votes
0answers
109 views

Create custom fields/meta data gender+country - radiobuttons and dropdown on register screen for these fields

On register I want the user to select gender (radio buttons) and a country (dropdown from list of countries) as well as an agreement checkbox. I'd also like all of these to be editable on the user ...
0
votes
1answer
243 views

WP_User_Query with combined meta query - not working?

I'm trying to use WP_User_Query class to list all users basing on their specific meta fields. When I use simple single-meta query, it works fine: $q = new WP_User_Query( array( 'role' => ...
0
votes
1answer
104 views

How to Make admin Sidebar Menu always be Collapse by code

I have solution with js that click on the Collapse button, but this is no good solution. I want to make this work true DB with php code. I found that the table who hold this value is wp_usermeta. ...
0
votes
1answer
226 views

Sanitize textarea instead of input

I want to add a new field to the user registration. I'm using this tutorial: http://www.paulund.co.uk/add-custom-user-profile-fields It worked great for me, but I want to switch the input text to ...
1
vote
1answer
94 views

Query wp_usermeta alongside wp_users

I want to use the WordPress query functions and no external plugins for the task. Here is what I have so far: add_filter('user_search_columns', 'user_search_columns_bd' , 10, 3); function ...
0
votes
1answer
26 views

Update vs Insert logic but the last key is always inserted?

I have added a custom db table which looks like usermeta table, just storing some key - value pairs. But now i am stuck with the following logic a/ if key exist for a user use an update query else ...
0
votes
0answers
139 views

Custom Post Type admin order by usermeta value

I would like to allow admins(and users) to order the listing of posts by editor(custom role) last name(ASC or DES) while viewing the listing of posts in the admin area. I have a custom post type that ...
0
votes
0answers
170 views

Custom query to update user meta data (also with a custom table)?

I have add a custom table (wp_shopping_metavalues) to the WP install which looks like wp_usermeta. I am displaying user values from both tables. For the insert i use function ...
0
votes
1answer
40 views

If logged in user meta is

I was wondering if it's possible to display certain content if a user meta field is set to a certain value. The most related thing I could find is get user meta, however it seems to get the user ...
0
votes
1answer
84 views

Remove fields from Wordpress profile

Does anyone know how I can remove the Twitter and Google Plus profile fields from my functions.php? This is the code that I am using: function modify_contact_methods($profile_fields) { ...