Tagged Questions

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

learn more… | top users | synonyms (2)

0
votes
0answers
16 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 ...
0
votes
1answer
22 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
16 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
25 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
20 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
19 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
48 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
42 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
44 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
42 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
46 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
16 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
55 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
55 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
30 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
38 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) { ...
0
votes
0answers
29 views

Getting user meta value in default user list in wp-admin (MU)

is there any way I can get value from a specified user meta in the default user list in WPMU? I am talking about the wp-admin/network/users.php list. It lists Username, Name, E-mail, Registration date ...
0
votes
2answers
70 views

Serializing User Role for update_user_meta

I've created a custom user role and am attempting to change the users role from CUSTOMER to ADVOCATE on purchase of a particular product (using WooCommerce). I'm really close but struggling to get the ...
0
votes
1answer
36 views

How to query authors by custom taxonomy?

I have a custom taxonomy for users which is country. Is there a way to query all admins by term_id or should I get all users and check each one with a for loop? I tried this: $user_query = new ...
0
votes
2answers
58 views

Storing user submitted forms [closed]

I was wondering what's the best way to create a form which can only be seen by registered users. The main idea I'd like to achieve here is for users to log in and gain access to a page where there's ...
1
vote
2answers
40 views

How to use an associative array in post__in with WP_Query?

I have stored user favorite posts in the user_meta table of WordPress. The data is stored in a format, for example a:1:{s:8:"post-134";s:3:"134";s:8:"post-136";s:3:"136";}. How can I get this in the ...
1
vote
2answers
81 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
0answers
16 views

WPMU add custom colum

I managed to add the columns that I wanted in all the wpmu sites using: add_action('manage_users_columns', 'header_column'); add_action('manage_users_custom_column', 'manage_column', 10, 3); ...
0
votes
2answers
29 views

E-mail Update - Validation

i want to know what is wrong with this code: if ( !empty( $_POST['email'] ) ){ if (!is_email(esc_attr( $_POST['email'] ))) $error[] = __('The Email you entered is not valid. ...
0
votes
1answer
34 views

Automatically Populate Post Taxonomy Data Based on Post Author Meta Data?

I'm trying to use author meta data to automatically populate a custom taxonomy on a given author's post(s). Currently, the taxonomy is visible on the post page, but I intend on hiding it from the ...
0
votes
2answers
58 views

Function to pull data from user meta not working

So I am attempting to create a series of functions that calculate a price based on a client level I have set for each customer. Some customers may have a special deal. To do this, I created a custom ...
0
votes
0answers
24 views

GET user's metadata, list it in descending order and GET user's list number

I have a custom user metadata with meta_key reputation. The value is numeric. It is like a points system. The higher value the user has, the higher reputation they have. How do I GET where each user ...
0
votes
1answer
106 views

Custom registration form and custom field

I've created a custom registration form for my website with this code: <?php /* Template Name: Registrazione-Custom */ get_header(); ?> <!-- Row for main content area --> ...
0
votes
0answers
41 views

Query to select specific users is not returning any users

I use wordpress and have the following query to select specific users, but the query is not showing any users when running it put together. global $wpdb; $date2day = date("d-m-Y"); ...
1
vote
1answer
59 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 ...
1
vote
1answer
40 views

WP_user_query throws a 404 error

I'm trying to get Wordpress (3.9.2) to search meta_key's in usermeta. I have tried every example provided on every site I've searched but I keep getting redirected to the 404 error page. I've tried ...
0
votes
1answer
41 views

New User Save Filter

I'm using the new(ish) filter add_action( 'user_new_form', 'funcy', 9 ); to add custom fields to Create A New User page. I'm then using add_action( 'personal_options_update', 'save_user_meta' ); ...
0
votes
0answers
24 views

How to operate two wordpress databases simulataneously?

I am having a situation, where i have two wordpress sites. One is for saving the data and content and other is for showing the data/content. Now the situation is, i want a user to register on one ...
0
votes
1answer
80 views

Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page

I have already published this on StackOverflow, but I realised it would be better to post it here instead. I am using the CMB script (Custom Meta Boxes and Fields for WordPress) for uploading files ...
0
votes
0answers
91 views

Get User ID on registration form before submit

I am creating a registration page and not using the wp-register page. Is it possible to pre populate the username field with the user id the person will be assigned with? So the username field will ...
0
votes
1answer
55 views

Update user meta array using foreach

I have two arrays consisting of keys and values: Array consisting meta keys: $user_meta_fields = array ( 'first_name', 'last_name', 'job_title', 'college', ...
0
votes
1answer
36 views

update_usermeta don't work

When I return in the function $setfound, I become a white screen and when I return $setlink, it works fine. function editsteamlink(){ $setlink = $_POST['steamlink']."/?xml=1"; $setresponse = ...
0
votes
2answers
35 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
185 views

using update_user_meta to rank users

I'm using a plugin that allows users to vote on posts, I'd like to add each vote that's cast to the authors user_meta so I can rank users the same way I rank posts. There's a couple of different ...
0
votes
0answers
52 views

Storing user meta as an array, empty array index shows as “Array” on front end

I am storing user meta data as a single entry in the DB as an array. If any of the array index values are empty, when I display the empty data it shows up as "Array". In particular in my user update ...
1
vote
0answers
27 views

User meta conventions / name registry, for social media links

The Yoast WordPress-SEO plugin adds some social media links to user_meta: function update_contactmethods( $contactmethods ) { // Add Google+ $contactmethods['googleplus'] = __( 'Google+', ...
0
votes
1answer
52 views

How to work with AJAX and Wordpress?

I'm working on my first plugin. I would like to add a follow button for the posts, so the logged in users can follow the authors. I placed the following lines into functions.php function ...
0
votes
0answers
29 views

Role Column Sorting

I'm trying to add sorting on Role column on user listing by desc and asc but I can get it work, it always show "No matching users were found." below are my code add_filter( ...
0
votes
1answer
43 views

Display a post count from a custom metabox selection

I was wondering if this is possible. I have a custom post type call projects that displays a metabox with drop down menu. In that drop down menu I have a few choices listed, draft, open, pending, ...
0
votes
3answers
124 views

User description only displayed for logged user

In my "About" page I list all WP users of the site. Then in author.php I display the description of the selected user with this code: <?php the_author_meta( 'description' );?>. Problem: this ...
0
votes
0answers
84 views

UPME Known Issues - Unable to Save Custom Fields

When you have large number of custom fields, there are issues with saving and updating process. This is due to the maximum input variables constraints set by PHP. Currently you have to increase php ...
0
votes
1answer
50 views

Is it possible in WordPress

I am trying to create a ranking based on user donation, my problem is I am not sure if wordpress user meta support append For each Project a user can donate money via paypal In WordPress User Meta I ...
0
votes
0answers
125 views

Create a dropdown list displaying users meta data

I want to display a dropdown list of users using information from the wp_usermeta table. I know that there is a method wp_dropdown_users that outputs a select list of users but I can't figure out how ...
0
votes
0answers
12 views

Default Custom Field User Data

I want to create a user meta that would either add or update In the user meta there are two custom field 'projects' and 'amount' so if user donated $1 to project A the user meta will create a row, ...
-1
votes
1answer
34 views

Store subscription details for users in Wordpress

I want to store subscription details of several category for users. how to store this to wp database. i am beginner to wordpress. whether i want to create new table or can i use meta ,taxonomy or ...