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

learn more… | top users | synonyms (2)

12
votes
3answers
7k views

How to create a front end user profile with a friendly permalink

I want to create a public front-end profile page with a friendly url like this format. mysite.com/user/someusername Any idea on how can i achieve this? I know it has something to do with rewrite ...
7
votes
3answers
791 views

Add default WordPress tag meta box to User Profile

I've set up my user profiles to allow custom taxonomies following this tutorial. Ideally, I'd like to use the default Tag meta box from the Post screen, so users can easily add new terms and find ...
6
votes
2answers
3k views

user_login vs. user_nicename

When you call the get_users() functions, a list of user objects are returned. Each of those users has a number of properties. What is the difference between user_login and user_nicename in those ...
6
votes
3answers
190 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. ...
6
votes
3answers
6k views

Get basic Image Uploader on User Profile Page

I am trying to add an image uploader to the user profile pages. I do have it up and running on a basic registration page, but somehow the same, but slightly adjusted code does not work when added to ...
6
votes
1answer
216 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 ...
5
votes
3answers
12k views

How to get a buddypress user profile link and a certain user profile field for the current post author?

I want to replace get_author_link() and get_the_author_meta($feld) with something equivalent to point to the author of the current post Buddypress user profile page and retrieve a specific profile ...
5
votes
2answers
935 views

get_users is expecting unserialized meta_value

I'm trying to get all users assigned to a custom usermeta. I know that get_users() is supposed to work; however, it doesn't seem to be working. What I have is a usermeta storing a category ID and I'm ...
5
votes
1answer
191 views

Content hooks vs User hooks

This is more of a theory question than a question with a direct answer. I've been working with different actions for firing functions when a post is updated or deleted and when users are updated or ...
4
votes
2answers
1k views

get_user_meta() to Return User Meta Only for Current Blog in Multi Site

I've written a plugin that allows users to bookmark their favorite posts, but have run into a small problem when using it on a multisite network. Each time a post is bookmarked, the ID of that post ...
4
votes
1answer
173 views

How to create a template for a custom URI associated with the user

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites. I created a page called my-favorites which allows the ...
3
votes
8answers
7k views

Adding fields to the “Add New User” screen in the dashboard

I'd like to add the field "Company Name" to the add new user page in the admin panel. I've done quite a bit of searching and have been unable to find details on how to do this. I can easily add info ...
3
votes
2answers
4k views

How do you update user_email on the front end in WP 3.3?

I am using the following code and everything in the user profile is updating except the user's email. In the template: global $current_user, $wp_roles; get_currentuserinfo(); /* Load the ...
3
votes
1answer
1k views

Where the Nickname is being used in WordPress

I see most of the place is using the "Display name", so why I need to set a Nickname? Where it is being used?
3
votes
5answers
5k views

Problem storing arrays with update_user_meta

I am writing a function that adds an ID number to an array and puts the array in the usermeta. $_GET['auction'] is the post_id. Here is the function: $reminders = ...
3
votes
3answers
1k views

wp_get_current_user always returns 0

I'm new to wordpress and modifying the code that's already working on a website. I want to get user's ID but I haven't figured out yet how. The following sample code works on my local environment but ...
3
votes
4answers
905 views

If Else Gravatar Author Picture

Ok so i have added a custom field inside of the WordPress edit profile field where a contributor and above can add a custom image if they do not use gravatar. Now i am trying to write a if else ...
3
votes
3answers
986 views

LEFT JOIN, INNER OUTER JOIN, LEFT OUTER JOIN is driving me crazy. Please help?

fellow coders! I an having a hard time JOIN(ing) tables. I have a a lot of users on my site and many of them have the same last names. I am trying to get their emails by their last name. WP stores ...
3
votes
2answers
3k views

Allowing an email as the username?

Is it possible to allow people to utilize their email as their username?
3
votes
1answer
456 views

Show Biographical Info while creating new user

Is it possible to show the Biographical Info textfield while creating a new user? I know it's possible to add user bio by editing a user AFTER it has been created. But I would like to do this while ...
3
votes
2answers
406 views

Connect Users and Taxonomies

I'd like to send email notifications when new posts are saved. But users can select post categories they want to subscribe to. Available plugins are no solution to me – I really need my own code base. ...
3
votes
2answers
2k 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 ...
3
votes
2answers
439 views

Search multiple meta keys at once

How would I modify the following SQL Query to allow me to search multiple meta keys at once? e.g. user_business AND user_about In the end I'll be searching about 40 - 50 different meta keys; or if ...
3
votes
1answer
338 views

How do you make the email field on the profile page read only for subscribers?

I would like to make the email field on the profile page for subscribers read only. They can see their email but not change it. I want only admins to to be able to change users email address.
2
votes
2answers
648 views

How to use hyperdb to separate and share a user dataset between wordpress installs?

I'm looking for a way to separate my users and usermeta table to be in a different database than my main WP install. The end goal is sharing these table over a number of WP installs. From what I ...
2
votes
1answer
431 views

How do I update a specific object in an array, in user meta?

I have this array, below, to set custom user meta (lh_userbadges) in user_meta but I'm not exactly sure how to update just parts of the array later on... $lh_user_badges = array( ...
2
votes
2answers
54 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 ...
2
votes
1answer
229 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 ...
2
votes
2answers
1k views

Ordering users of a specific role by last name

I'm trying to display a list of authors by their last name. I can get the list to display but as yet I don't seem to be able to order the list by last name. Any help would be greatly appreciated. Josh ...
2
votes
2answers
3k views

Can I create front-end editable user profile pages with Wordpress? How do I do it?

I'm trying to build a WP site where using the front-end, each user can: Register through the front end using basic fields Log in Create their own profile page using multiple forms Upload text, image ...
2
votes
2answers
944 views

Add mass action to wp-admin/users.php

I'm heavelly modified my Wordpress, it's amazing what you can do with wordpress hooks, actions.. But i'm not able to find how can i add mass action for users. Let's say i select 5 users and i want to ...
2
votes
1answer
349 views

Post-Registration, post-meta hook?

Is there a hook in WP to access meta data of a user JUST after they have registered and meta data has been added to the database? I was reading to use profile_update, but wouldn't that be invoked ...
2
votes
1answer
1k views

How to update serialized data in the user meta data

In my wp_usermeta table I have a field called "wp_s2member_custom_fields" In it is stored this value: a:2:{s:6:"alumni";s:3:"Yes";s:19:"donations_collected";s:2:"10";} I am trying to use: ...
2
votes
1answer
1k views

Validating a new user registration field

What I'm trying to do: Add new user meta fields that can be updated when the user edits their profile Validate them correctly when the form is submitted What I've done: I have successfully added ...
2
votes
2answers
1k views

Displaying additional User Contact Information

I have been advised how to add additional contact info fields to the User admin area here (Click here). However, I am not entirely sure how I can display the the field contents in a link within my ...
2
votes
2answers
3k views

How to search for users based on added user metadata

I have added several new fields to the user profile (areacode, company, affiliate, etc) and I would like to present a way to search on these fields. Please point me in the right direction.
2
votes
1answer
17 views

What is the meta-box-order_post_hash used for?

meta-box-order_post_hash is stored as an user option. I am sure it's related to meta-box-order_post but I could not find anything in the codex about it. So what is it for? And how can or should be ...
2
votes
1answer
398 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 ...
2
votes
1answer
299 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 ...
2
votes
1answer
232 views

Add a member number to new user

I need to add a number to user as meta info (it's a 5 digit number) at the time they register. I assume I would use the user_register action to call a script. I also assume I would use ...
2
votes
1answer
294 views

Querying Email Addresses for a List of Users with Same Last Name?

I have a site with many users and many of them have the same last name. I want to get the emails of all the users with the same last name (IE: Smith) that has a post related to a particular taxonomy ...
2
votes
1answer
637 views

get_usermeta() deprecated in favor of get_user_meta(). But why doesn't it make use of it?

While coding WP I just wondered about this simple fact: get_usermeta() is deprecated since version 3.0. The warning suggests me to use get_user_meta(). Even the parameters are pretty similar, I ...
2
votes
2answers
564 views

update_user_meta doesn't work with AJAX

I try to keep user subscription in a metadata var. The function is called by AJAX. Ahe AJAX is called but the metadata does not seem updated on frontend. Here is the code: jQuery <script ...
2
votes
2answers
2k views

wp_update_user not updating

In desperation I am asking for help in this forum too - if someone (ANYONE!) could take a look a this post and see if they could help I'd be eternally grateful ...
1
vote
1answer
1k views

Extend the wp_users table

I'd like to to extend the wp_users table in my WordPress' database. Why? I want people to add more information about themselves when they sing up at my website. I know how to extend it, but I'm ...
1
vote
1answer
885 views

remove user_meta data from database for all users

I'd like to create a button for admins to be able to delete from table wp_usermeta -> key: 'ref_credit' for all users. Is there simple resource friendly way to do this? does wp have built in function ...
1
vote
1answer
1k views

Getting $user_id for the_author_meta outside the loop in multisite

So I am currently running a multisite install where the super admin creates all new sites. One of the templates we're using has a blog page for a loan officer. I am extending the user profile so the ...
1
vote
2answers
202 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 ...
1
vote
1answer
127 views

Is it possible to store visitors IPs in wp_postmeta table?

Or in any of the other 11 Wordpress tables. I also need to store: submission date, name, contact number in the same table. What approach would be best? A custom table or using a standard table?
1
vote
1answer
4k views

wp_update_user doesn't update and update_user_meta does

I'm building user profile page where users could update their profile on the front-end. User profile is extended with a few custom fields, like 'Twitter', 'Facebook' and 'City'. The following code ...