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

learn more… | top users | synonyms (2)

0
votes
1answer
411 views

Display users in order by an “order” custom meta field

Alright, so here's my current code (which works, displaying the users in order by ID and excluding the admin user): $site_admin = "1"; $order = 'ID'; $user_ids = $wpdb->get_col("SELECT ID FROM ...
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 ...
1
vote
2answers
449 views

Update user meta of author when post content is viewed

I have a value that I'm trying to store as user meta for authors on my site. I need it to update itself every time the content of a post is viewed for that author. Here's as far as I've gotten but it ...
0
votes
0answers
21 views

Join wp_users and wp_usermeta

I have a custom user meta named created_by, which is the ID of creator of this user. I want to create a view table like this for example: ID user_login created_by 2 andi admin How to ...
0
votes
2answers
19 views

Get meta value and associated user meta

I'm working on a site where users are able to publish posts with custom fields associated with them. I want to display meta values from all posts, and include which user created the post where the ...
1
vote
1answer
28 views

How to store custom user data on the database?

I'm developing a WP multi-site network which have a goal of 10,000 sub blogs. The site needs to store custom data related to the user. There are additional 20 fields of data for each user. What is the ...
0
votes
0answers
13 views

Update_user_meta fails with ajax when used multiple times quickly

I'm trying to update the status of the sidebar (visible or hidden) when the user clicks the hide/show button in the user_meta so that no matter what computer he's on, he'll see his settings saved. ...
5
votes
2answers
256 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 taxonomies and ...
1
vote
4answers
255 views

How we can get the user id by its display_name

I have user display_name and with this I want to get the id of that user. So, how can I get the user id?
2
votes
2answers
952 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 ...
0
votes
1answer
253 views

Help integrating Custom post type meta field with custom profile fields

I have a custom post type for "locations" and I need to have "users" log in and be able to pick a location that is within a certain distance from them. I have added some spots to the profile using ...
0
votes
0answers
36 views

wp_usermeta key problem

I am trying to add a meta key to wp_usermeta but it does not work at all. The key would get value from a checkbox. I used the code from Wordpress codex tutorial and it's not adding anything. I will ...
0
votes
1answer
23 views

Wordpress Author Information show paragraph?

In back-end I'm update 3 paragraph in Author information. But it's showing frontend it's collapsed. And not showing paragraph. How to fix this problem. Ex: paragraph 1. paragraph 2. paragraph 3. ...
0
votes
2answers
88 views

Let user select their own category

I would like to let category editor appear to any user and user can edit their preferred category(ies). For example: the category is about kind of job or profession and there are 10 ...
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
23 views

SELECT from wp_users, get Displayname too

SELECT post_author, count(ID) as amount FROM dbold_posts WHERE WEEKOFYEAR( post_date ) = WEEKOFYEAR( NOW() ) AND post_status = 'publish' AND post_type = 'post' GROUP BY post_author ...
1
vote
3answers
31 views

get_*_meta doesn't always return an array

I find it annoying that functions like get_user_meta or get_post_meta will return an array if the meta key exists or false if it doesn't. This means I need to do a check like so: $meta = ...
0
votes
1answer
23 views

Why checkbox is not saved in user profile page?

I added new options in user profile page. I added checkbox but it is not saving if all multiple options are checked. <input type="checkbox" name="neww" class="neww" value="one"<?php ...
0
votes
0answers
134 views

Wordpress Subscribe to Receive Update notifications on a Post

I have been looking around for a wordpress plugin/function that allows users to subscribe to a specific post to receive updates from that post. For example, anybody who subscribes to receive updates ...
0
votes
1answer
49 views

Delete user from frontend

Hi I am working on a frontend admin where a user must be able to delete his account. current_user() is a custom made function of me that retrieves the user meta data. Does anyone know how I can make ...
0
votes
1answer
25 views

Hide user fields based off capability

I'm struggling with this one. I am trying to hide 2 user profile fields for the current user. Only the admin or user with "edit_users" capability should be able to view/edit these fields. Code: ...
0
votes
0answers
24 views

get_the_author_meta not working when sending emails

I can't seem to get "get_the_author_meta" working when sending welcome emails to users. I want to customize the content based on custom user meta. I can pull it in just fine on the front end, but I ...
0
votes
1answer
28 views

Minimize database queries to user tables?

I'm trying to come up with a strategic way to collect large amounts of usermeta data (and output to the screen) while keeping database queries low. Some pages, like the home page, single pages, and ...
0
votes
1answer
55 views

Updating User Meta with SQL Query

I have a Wordpress site that needed to have 9,000+ users imported to set up a Directory Listing. I imported them from an existing MySQL (non-wordpress) database and everything imported just fine. ...
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
21 views

Store Foreach in user profile

I use a foreach to get visits / visitors per month with Analytics API. I need to store the results in the user profile the way it is displayed with an echo. I tried this but I don't get the right ...
0
votes
1answer
74 views

WP Cron: Save third party data as user meta

Editors note: Twitter ID and Google Analytics only serve as examples and are exchangeable. TL;DR I want to save external data in a user profile once or twice a day. I added two custom fields in my ...
0
votes
1answer
45 views

How to delete user meta by key

I'm a beginner with WordPress plugin api, php and ajax. I'm coding a training plugin for myself to save posts article to read them later, like favourites on web browser, with folders. I use oop to do ...
0
votes
0answers
17 views

Save automatically data to user profile once or twice a day [duplicate]

The main goal : I am working on a panel which will display statistics of my user websites (external website). For that, I use the Google Analytics API. I save the Google Analytics profile number in a ...
0
votes
1answer
21 views

Display and Update User Custom Meta via user-edit.php

Is there a For/Loop available to display all the available WordPress User Custom Meta Data so that when on the user.edit.php screen you can see and update all custom metadata? I understand methods ...
0
votes
1answer
40 views

Assign random (and unique) user meta upon registration

When a user registers, I need to assign a random but unique, 4-digit number as user meta data. The number will be static and not change: Not by the user himself or any user with a higher capability. ...
0
votes
1answer
27 views

Set user ID at time of wp_create_user

I'd like to add a new user to the WordPress user table. The code for wp_create_user works fine but it is adding the user incrementally to the next available ID in the user table. Instead, I want to ...
3
votes
1answer
108 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. ...
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'] */ ...
1
vote
0answers
49 views

How to save the date/time of last update of an extra user profile field?

I have a function that adds and saves very well an extra field to the user profile. But, because the content of this field gets old very quickly, I need to know when the user refreshed it last time - ...
0
votes
1answer
36 views

Add new user and add meta at once

I am working on a custom sign up proces where a user first fills in his name and email, then receives an activation e-mail and then the sign up proces continues. The e-mail contains an activation ...
0
votes
0answers
18 views

Adding a function-based search to the Users admin page

On the Users admin page, I want to add a function-based search criterion. By default, there are filters to search by user role and there is a search box that searches the user data. I would like to ...
1
vote
6answers
3k 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 ...
0
votes
1answer
40 views

Meta box with front-end styling

I have a specific Gallery post of products that I release at the start of every Monday on my website, which differs from my other Gallery posts. These types of Gallery post don't require the Authors ...
0
votes
1answer
71 views

wordpress simple post multi rating with post_meta and user_meta

I am trying to create a multi criteria post rating function with simple form and post_meta and user meta. The Goal when users submits their ratings 2 things should happen: 1.the ratings is stored ...
0
votes
1answer
60 views

Get author meta of all writers

We know from the docs that you can get an author's meta like so: <?php get_the_author_meta( $field, $userID ); ?> But I would like to have a custom "About us" page which displays all the ...
0
votes
2answers
255 views

Getting list of top 10 users and sort on last name

I would like to display a list of the top 10 authors based on the amount of posts that they have, and then sort them on last name. To my knowledge, this is not trivial since the last name of a user ...
4
votes
1answer
85 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 ...
0
votes
0answers
39 views

Use and get custom user metadata

I wanted to check if a post custom field matches the logged user's custom metadata. If it does then list only posts that match. I think that's possible.
0
votes
0answers
46 views

get_userdata() not working in my plugin

i am using get_userdata() function in my plugin but it is not showing any values, it is showing blank result. I am able to see the value present in phpmyadmin. I am using it in a plugin ...
0
votes
1answer
29 views

Conditionally process comments while ignoring replies

I use a WordPress theme that awards users points (kept track of in user meta-data) for posting comments. However, they are not awarded points for replying to a comment. When I move a comment to the ...
0
votes
0answers
9 views

Add_action not updating user_meta when trashing multiple checked posts

I have a point system to my wordpress theme. I've recently added a function that removes one point from the member if I remove their post. However, when I check and remove multiple posts in the ...
0
votes
1answer
43 views

Multisite - Echo admins profile meta

I'm having a problem with echoing the admin's profile meta in a custom post type template. It used to work, but for some reason it's not working anymore. I'm not aware of any changes made that would ...
0
votes
1answer
45 views

How does adding custom meta to signup form work?

Following along with the answer posted here, How to add Custom Blog Options to new blog setup form? I am attempting to understand why the custom meta is added to the options table for the blog as ...
0
votes
2answers
368 views

No first_name or user_firstname property in WP_User object

I'm writing a basic plugin. Here's my code: $new_user = get_userdata($user_id); $first_name1 = $new_user->user_firstname; $last_name1 = $new_user->user_lastname; echo "<" . $first_name1 ...