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

learn more… | top users | synonyms (2)

0
votes
0answers
55 views

WP_Query with intersection of post meta field and user meta field

On the site I'm building, each post has a serialized array of strings. Let's say post ID 1234's value for my_site_teams is array( 'Chess', 'Cheerleading', 'Football' ). Each user also has a ...
0
votes
0answers
34 views

Is it possible to make custom columns in the user.php file to be sortable based off meta values?

I've googled around and not seen any answer that really works so far so I thought I would check and see what others say. I'm working on a plugin that adds three different columns filled with meta data ...
0
votes
1answer
55 views

Retrieve user_meta and copy to post_meta

As geo mashup only retrieves post_meta, I am trying to copy over the geo_location from a custom registration field into the meta for page containing the map. The code I am using is: <?php ...
0
votes
1answer
248 views

Add a button to users.php

I am working on a plugin that adds meta data for each user to the users.php table that is displayed by adding columns. I have that done but I would like to also add a button that will delete the meta ...
1
vote
1answer
88 views

Lock user information once fields have been filled in

Much like the username is locked down and cannot be changed once it has been registered, I would like to lock down additional fields I have created with Advanced Custom Fields like the person's ...
0
votes
1answer
337 views

Gravity Custom Merge Tags

I created some custom profile fields following the advice of Thomas Griffin and Stephanie Leary. Like so: function change_contactmethod( $contactmethods ) { // Add some fields ...
0
votes
2answers
38 views

Let users register weight each day and save it in DB

I need a way that lets my users register they're weight (kg) and maybe % of bodyfat and save that information on each user in the DB. Then i need a way to output that number again on the logged in ...
0
votes
0answers
139 views

Edit profile custom fields display

I have function which shows additional info on edit profile page (just text no input fields). Problem is it works only for user_login and user_email - doesn't work for custom fields (fields are from ...
0
votes
1answer
23 views

Creating Custom user type just like custom post

Any method for creating custom user types just like custom post. am trying to achieve 2 different set of users with different user_meta fields.
0
votes
1answer
51 views

Cannot update user display_name field

I'm trying to update user display name when posted through a form. Here's what I'm trying: if ( !empty( $_POST['display_name'] ) ){ //var_dump($_POST['display_name'] ); wp_update_user( ...
0
votes
0answers
67 views

Perform a function to create/delete custom post only if certain user meta checkbox is set to true

I have a website where I would like all subscribers to be able to create or remove a post that says they are accepting new patients (they are doctors) by checking or unchecking a custom checkbox that ...
1
vote
0answers
104 views

Frontend Image Upload

I have the following code used at the top of my front end user profile page, everything works and displays fine except for the following problem .... If I upload an image and submit the form usermeta ...
0
votes
1answer
230 views

Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?

even though I think I understand the hierarchy of roles in WordPress, I never really bothered creating my own user roles or custom capabilities. What I need to achieve is to assign a few capabilities ...
3
votes
2answers
443 views

How to display custom user meta from registration in backend?

I'm considering using the hooks for the WordPress registration form to add some custom fields: https://codex.wordpress.org/Customizing_the_Registration_Form My question is, if it's even possible, how ...
0
votes
2answers
111 views

Adding an option to a shortcode

I'm trying to write a shortcode that will allow the option to display all users or show a singular user, defined by a user id or "nicename". The shortcode would look something like this: [staff ...
0
votes
1answer
65 views

Validate user meta and redirect

I wanted to add some extra fields to obtain extra user info which I have added easily that looks like. The example code for a single form field, I added: add_action( 'show_user_profile', ...
0
votes
1answer
27 views

How to list users by custom field?

I have a custom user field in the standard database, called company. I want to output on to a page the usermeta info only of users whose company matches Widgets Inc ... How do I do that? What I'd ...
0
votes
2answers
166 views

How to hook into user registration process Before user registers

I need to add a field to the user registration form and then validate it before I add a new user to my WordPress I know how to hook into the registration form via add_filter('register_form', ...
0
votes
0answers
18 views

Calculation for each custom post type

I have a code looking like something like this: (It calculates number of registered members for each course) foreach($courses as $course) { global $wpdb; $sql = "SELECT COUNT(*) FROM ...
0
votes
1answer
837 views

Displaying a Welcome Message to a Woocommerce User

In the registration fields, I've introduced an two additional fields that take the First name and last name of the registering user. In my woocommerce-functions.php I define (user_firstname/lastname) ...
0
votes
1answer
92 views

Add profile field (usermeta) to Add New User

Edit: Add profile field (usermeta) to user registration I am trying to add a custom field to the Add New User page much as I have done with the user profile page like so: add_action( ...
0
votes
2answers
147 views

Can't get the user_meta correctly

I have this code below: function get_user_fields($user, $output = true, $main_title = 'Anmäld till kurs/kurser', $course_update = false) { if ($output === true) { if ...
0
votes
0answers
35 views

How to delete usermeta after a user is deleted?

Using the admin panel, I deleted several users that I thought were attempts to spam the site. But the records for these users are still in wp_usermeta. As a result, the user count on the admin panel ...
0
votes
1answer
40 views

Display site admin profile fields in header.php

I am working on a multisite setup and Im trying to display some meta from the site owner's profile. I tried the following code but it is echoing the super admin's meta instead of the current site ...
0
votes
1answer
471 views

Select User by Joining Multiple Meta Value Results

( I would ask this in the general stack exchange forum but I think it is more relevant here. I'm intentionally using direct queries to the database here. ) I'm trying to select a group of users that ...
0
votes
1answer
205 views

wp_insert_user not creating account correctly when ID is manually set

So, I'm trying to create a new user account with wp_insert_user based on credentials I receive from a Facebook user profile. I want the new user account ID to equal the Facebook account ID (ex: ...
1
vote
1answer
36 views

A field with dashes in the slug [closed]

How do I reach a specific userdata in the database, when that field has a dash (hyphen) - in the slug? I use the plugin WP-Members. I have created a new userdata field with the plugin with the name ...
0
votes
1answer
229 views

SImple Example To Update User Info From Front End [duplicate]

I want to give user ability to update their nickname from front end using wp_update_user and shortcode. The code below is working. add_shortcode('user-profile', 'get_current_user_prof'); ...
0
votes
0answers
20 views

use single form to enter multiple profiles

I want to allow users to add a business profile to their accounts. I have setup a form that posts the business profile information into user meta, and displays that info as part of their main profile. ...
0
votes
1answer
72 views

Get users with different roles and call function on each of them (user_meta)

First of all, I have a custom function in functions.php that gets some author information. This works on great on single posts with a single author. <?php function the_author_box() { ?> <div ...
0
votes
0answers
47 views

How to Sort User list by meta_key and meta_value

I am very newbie in wordpress and stuck into a task for many hours and not getting any way to sort out this, Thats why I am here.... I want to display a sort list of user based on meta key and meta ...
0
votes
0answers
56 views

Assign specific editor with custom user meta “A” to all authors with custom user meta “A” and exclude all other author access

I am looking to do the following: Logic/layout/cores: All contributors select a school in a custom user profile meta field All contributors also select a club in a custom user profile meta field ...
0
votes
1answer
41 views

Allow users to create and store data and retrieve it on login

I write a wedding blog and would like to allow the subscribers to login and be able to create and save their own wedding guest lists. The data they store, should be retrievable on future login to the ...
0
votes
0answers
34 views

When login session ended

I'm trying to add a user meta on user login with hooking to wp_login and then wannna delete this option after user logged out or his session expired. Is there any hook on session expiration to ...
0
votes
1answer
248 views

How to create user personal pages with information from their meta profile fields?

I asked here how to create virtual pages with information from the user meta profile fields using an external class. I got a good answer and also I have implemented it successfully (thanks to @g-m!). ...
0
votes
0answers
184 views

The right way to update Front-End user profile fields individually?

I'm designing a Front-End user profile page, allowing users to view and update their own profile information. I have the template page made, with the code to edit the profile fields as a whole from a ...
1
vote
1answer
149 views

WP_User_Query pulling ACF to loop

I'm using following code to display my users on template <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $paged -= 1; $limit = 100; $offset = $paged * $limit; $args = ...
0
votes
2answers
131 views

How to access User meta data within a plugin

I am trying to write a plugin. I have added an extra field in a registration form using the plugin successfully. I would like to check whether the value in the extra field matches any username already ...
2
votes
1answer
183 views

How to create virtual pages with information from user meta profile fields?

Dave Jesch on his site presents a way to create virtual pages in WordPress. Dave created a class "to do all the heavy lifting", as he says. I think, for my purposes this class not require changes, so ...
0
votes
3answers
428 views

How to order users alphabetically by their last name?

I use the following shortcode and function to display members of some departments: add_shortcode( 'list_of_members', 'members_listing' ); /* usage: [list_of_members department = 'psychology'] */ ...
0
votes
1answer
81 views

users and usermeta table

Is it mandatory for each user to have entries in usermeta table as well or it's optional? Recently, I came across a wordpress database which has thousands of users in user table however only a few of ...
0
votes
0answers
49 views

How to remove capabilities based custom user meta

I am using woocommerce vendor plugin. So, Need to remove some capabilities when a user has a a certain field value for example -- if the user has a custom field Membership Type="standard" on his ...
0
votes
1answer
95 views

Users Select inside custom metabox

I'm using human made's custom meta boxes framework (https://github.com/humanmade/Custom-Meta-Boxes). I want to add a select drop down in my metabox wich is populated from the users with multiple roles ...
0
votes
0answers
78 views

Let admin users edit member profiles from front end

I'm using WP User Frontend Pro, but the pro version lacks the feature of letting admins edit registered users profiles from front end. I'm building a web app using WordPress, and the administrator ...
0
votes
0answers
35 views

Calling update_user_meta inside of another function doesn't work

I have a function that does updates a db outside of wordpress and then I'd like it to take that information and update the user_meta table in wordpress. The print statement prints all the appropriate ...
0
votes
1answer
638 views

add_user_meta() vs update_user_meta()

I'm looking at the docs for add_user_meta() vs update_user_meta(). If the current meta_key does not exist for a user, will update_user_meta() automatically add the meta_key for that user or do you ...
0
votes
0answers
48 views

the_author_meta not resetting

I'm looping through posts normally. I want to display the author ... simple <?php the_author(); ?> gives me "Patrick Daly". Nah, I just want the first name, so I use <?php the_author_meta( ...
0
votes
1answer
63 views

Add meta tag to search results

In the search results I use author_name=something in the url to restrict the results. The Problem is that domain.com/?s=searchterm and domain.com/?s=searchterm&author_name=something have the same ...
0
votes
1answer
176 views

Multidimensional array problem with update_post_meta [duplicate]

I have an issue saving a multi-dimensional array using update_post_meta. Here's my code ($meta_key and $userID are set up above): $read_notices = get_user_meta($userID, $meta_key); if (null ...
0
votes
2answers
128 views

update_user_meta on registration but only for default role type

So I am running the following to update user meta on regsitration: function set_user_rcp_default_subscriber($user_id) { update_user_meta( $user_id, 'wp_user_level', '0' ); update_user_meta( ...