Questions tagged [user-meta]
User meta data consists of key-value pairs pertaining to the according user ID.
866
questions
0
votes
0
answers
30
views
Create membership number for existing/new users
I have a membership site with 4000+ users currently on it.
I am needing to give both new/existing users an automatic ID number.
its very similar to this: Create Unique ID for user
However, this only ...
0
votes
1
answer
29
views
Sort users by meta key value even if meta key not present for all users
Only some users have a specifice meta_key some_metakey associated with their ID.
The following args successfully orders users with a specified role by some_metakey but only those with that meta_key.
...
0
votes
0
answers
16
views
Backend tool to list and classify users according to meta fields [closed]
My site is currently handling additional user data by saving it to user meta fields. I'm looking to add functionality to view users in the backend along with the meta fields of my choice and then ...
0
votes
0
answers
18
views
Linking form to user meta fields
I currently have my login page set up to allow sign up through google. Immediately after a successful sign up I'm looking to set up a redirect to a form where the user can enter additional details and ...
0
votes
0
answers
9
views
Auto populate a user custom field from another user custom field
I have a WP theme with its own custom fields including one for Phone Number. I also installed the Digits Plugin which allows users to sign up/login with their phone number and OTP, which has its own ...
1
vote
0
answers
42
views
Parent User and Child User - relate users
I need to create a system in which I have 2 types of users: Company User (C) and Employee User (E).
I need C to be able to register as many E as necessary and for C users to be able to publish ...
0
votes
0
answers
6
views
Add WordPress user custom meta to chartjs vertically stacked chart in Divi theme
I have created a user dashboard using the Divi theme where I need to add a chart like the attached screenshot. The data are specific for every different user. I have tried many premium plugins but ...
0
votes
0
answers
7
views
Compare User meta_value with Product meta_value
In Wordpress I've added a new field called "user_branche" on the user edit profile page within the admin. On the Woocommerce product page in the admin I added a meta field called "...
0
votes
0
answers
17
views
How to store checkbox data for individual users?
I am working on a video-course website and I would like to add a checkbox next to each video so that when a student finishes watching the video, they can mark it complete and when they return they ...
1
vote
0
answers
61
views
Rest API code to get ID of current user not working: get_current_user_id() gives 0
Background
I am trying to write Rest API code to get the ID of the user who triggers the function in question. I found a fantastic answer to this exact question, that was very kindly provided by user ...
1
vote
0
answers
28
views
How to redirect on login to a specific page if a specific meta user is empty
I would like to indicate that if you do not have the first_name filled in when logging in, you will be redirected to a specific page, for example /onboarding and if the first_name field is filled, you ...
0
votes
1
answer
17
views
How to pull all the contributer users records and order by Designation (which is users meta data)?
I want to show all the contributors by the Designation. Following code is only pull the records and order by ID But I need to data order by Designation:
function contributors() {
global $wpdb;
$...
0
votes
0
answers
29
views
Check For get_post_meta on Author Archive Page
I've had a good look thru the Similar Questions for an answer and i'm looking to check if a value for a custom field key on single posts has been added using get_post_meta(); however i want to use ...
0
votes
1
answer
41
views
Delay action unltil the untill previous (hoocked) action is completed
I'm quite new here so I hope you'll find my question documented enough. I've been digging into this for a while now, and haven't found satisfactory solutions, despites some looked relevant!
Basically, ...
0
votes
1
answer
26
views
User query - getting values for custom meta keys/fields
I am beginner at customizing wordpress but have some experience in PHP coding.
I'm struggling to figure out how to display all existing meta keys (custom fields defined by ACF) for all users that have ...
0
votes
1
answer
95
views
ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
I am looking for a way to query users based on a user meta entry for an advanced custom field which has a given value and itself is from a given layout type.
For example, let's say I have the ...
0
votes
0
answers
16
views
User following system via REST API
I'm trying to do a user following system with Wordpress REST API. I made some attempts, but I couldn't get out of it. There are too many bugs.
I am posting a data with 2 things: one of the current ...
0
votes
1
answer
22
views
How $_GET['updated'] variable is passed when updating a user?
I have added two user metas and they are functioning perfectly. Now I want to show a warning message according to the input. I have passed the status through a get variable(named meta_warning through ...
1
vote
1
answer
227
views
ACF: How to get the full field name (meta_key) by a field key?
In Advanced Custom Fields: Which function can I use to get the full meta key of a field by its field key?
So, if I have a field with the name some_field and the field key field_sd54hfs5df: How do I ...
0
votes
2
answers
41
views
Fetch user related data
In my WordPress installation every User has an Organization. I am fetching user data using get_user_meta ($user->ID). With these data I can fetch Organization ID.
Organizations are saved as Custom ...
0
votes
0
answers
18
views
How do I Populate a Table Field with User Meta Data?
I'm very new to this and hoping this is an easy question.
I'm trying to populate a row field with the organization name. The organization name is in the usermeta table.
<?php
break;
...
0
votes
1
answer
41
views
How do I echo all users' display_name and their meta_value who have a certain meta_key?
I have a meta_key inside the table usermeta called 'sms_subscriber'. The meta_value for it is their phone number. I want to echo a list of all users who have that field; in other words, a list of each ...
0
votes
0
answers
75
views
Wrong result in fetching User meta of WordPress
I have custom post type Task where I assigned Users as Volunteers.
Now I would like to fetch how many tasks assigned to a Volunteer.
I am using below code.
$users = new WP_User_Query(array(
'...
0
votes
0
answers
55
views
Fetch user's using Last Name
I am fetching All users using
$users = get_users(array('fields' => array('ID','display_name')));
code.
How can I fetch users who has certain characters in last name ?
Like I would like to fetch ...
0
votes
0
answers
19
views
Catching a GET parameter from the URL and save it in the user meta when a user registers
I am trying to catch a GET parameter from the URL and update the user meta when a user registers.
Currently, the approach I am using is:
Call a function that runs in the plugin constructor, which ...
0
votes
1
answer
24
views
Delete user meta but only if found in array
I created a SAVE button that saves a page's URL to the user meta in an array. I'm trying to now create a REMOVE button but I'm finding that when delete_user_meta is used it deletes all entries in the ...
0
votes
1
answer
16
views
Associate multiple email addresses with the same user account, so they can log in with either
Is there a way to associate multiple email addresses (2) with the same user account?
The goal is for the user to be able to use their company email or personal email to log into a company portal - ...
0
votes
0
answers
12
views
Get user edit functions in frontend for site admin
I'm new to WordPress development and programing, so apologies if this find very simple step to do for expert but for me i am really stopped here.
I am want to create front end page where site admin ...
0
votes
1
answer
38
views
last_name + first_name orderby with meta_query [solved]
I have small issue with orderby. I´m looking solution to orderby ASC (lastname + firstname) example:
Selanne Andy
Selanne Beeny
Selanne Teemu
But now it arrays something like this:
Selanne Beeny
...
0
votes
1
answer
29
views
Create Wordpress User in backend, and automatically create a new post in Custom Post Type with user uame as the Title in the post
We are developing a golf tour itinerary system for our clients, and we only want client with unique booking reference 221234 to see their tour itinerary, which is on a CPT titled 221234.
Is there a ...
0
votes
1
answer
36
views
How do I update user email from frontend input field?
I'm using the below function which is working for my phone and address fields. I can't seem to change the email though... any idea what I'm doing wrong?
function um_modifications_callback() {
// ...
0
votes
0
answers
33
views
How to get metadata (in my case mail) of users who have a certain set of metadata?
It's a really hectic day for me. Okay, I need to choose all users with some role, with and with some meta_data: subscriber, user_country, and user_sector for example.
In the beginning, I have several ...
0
votes
1
answer
327
views
How to get data from user meta custom fields created with acf-pro plugin?
I need to get user meta from the database and WordPress has the awesome function get_user_meta() for this purpose but, the problem is I need not default meta field. I need to get data from a custom ...
0
votes
1
answer
27
views
Getting users with a specific meta data and then querying their posts?
Basically what I want to do is first get users with a specific meta_key and meta_value.
And then query their posts.
Right now I'm using this:
<?php
$user_ids = get_users([
'meta_key' =...
0
votes
0
answers
22
views
Reading additional fields in PMPro
I am currently working with PaidMembershipsPro, so I wanted to simply add a field with a phone number using register helper and check if the phone number has already been registered on the website. To ...
0
votes
1
answer
22
views
Combining wp_list_authors with get_user_meta
i am using the wp_list_authors function as the following:
<?php wp_list_authors( array(
'show_fullname' => 'true',
'orderby' => 'display_name',
'order' => 'ASC'
)) ?>
...
0
votes
1
answer
180
views
Wordpress update_user_meta onclick button with Ajax
I have a button that is limited to 7 clicks, when clicking number 5 is disabled, My problem if the user login from different device, the count start againg in 0 same as refresh page.
my needs is, Save ...
0
votes
0
answers
17
views
How to display user_meta array as a table?
Ok, so I'm building a "Transactions" table for a user using user_meta array.
I'm new to this and trying to figure things out.
Basically, in practice I know how to store array to user_meta.
$...
0
votes
0
answers
40
views
Disable link after click by user meta data using js and php
I am working on a member site with a link, that after clicked, js will disable it. I would like the link to remain disabled permanently for the user after one click. I created php code that checks new ...
1
vote
1
answer
37
views
get_the_author_meta( $field, 0 ) returns the administrator $field
Just discovered that the get_the_author_meta( 'birth_date', 0 ) returns the administrator birthdate. The same happens with other $field parameters for $user_id = 0. Is this an expected behavior for ...
0
votes
0
answers
83
views
Change auth_cookie_expiration for specific roles and specific login times
In my db i have a login counter that keeps a number value as a record (1,2,3,4,5...)every time a user from a specific role logins.
I am trying to change the auth_cookie_expiration to 1 day for ...
0
votes
1
answer
308
views
How to add fields in custom registration form, validate it and aave to db? [closed]
I use a WP theme with a custom registration form. I want to add two fields to it (for phone number and company name). What to add to the php file of the form and what to the function file of theme ...
0
votes
1
answer
790
views
Users table missing from Database [closed]
I have a functioning WordPress site, with two users (an Administrator and an Editor). I can log in to the WP back-end fine with either user. I can create pages, etc. But when I look at phpMyAdmin, ...
0
votes
1
answer
72
views
Best Practice? - Saving multiple Values as Serialized Data / Saving each Value per Row / Dedicated Table
For each user the following is to be saved:
user_id
tag / tag_id (eg. 1,2,3,4,...)
timestamp first_seen (for each tag)
timestamp last_seen (for each tag)
Options which come to my mind:
One Row ...
0
votes
0
answers
15
views
how to create variable like this %user_posts_page% or like this {user_posts_page}
I am tryiing to create variable like this %author_posts_page% or like this {author_posts_page} to use with Wp user avatar plugig to generate profile link for user avatras. But this not work for me.
$...
0
votes
1
answer
47
views
How to add and subtract user meta values after post meta update
Basically, I'm trying to make a point exchange between current user and author when the post meta value is updated.
As well as add +1 to post meta.
Here's what I currently have:
// Coin exchange ...
0
votes
1
answer
42
views
How to update and save user metadata on page visits?
Basically I'm looking for something like this:
<?php if ( is_page( array( 'home' ) ) ): ?>
update_user_meta( $user_id, 'pagehome', '1' );
<?php else: ?>
...
0
votes
0
answers
24
views
upload image to specific folder by users
on my website i let users upload their profile image. at this moment they can upload their images and every thing is functional. the only problem is that their images are saved under /wp-content/...
0
votes
1
answer
70
views
cannot get user_registered date from get_user_meta
I am trying to display the user_registered date from get_user_meta but it always displays as empty. If I try another field I do get a value so not sure why I don't see anything for the date. If I ...
0
votes
0
answers
139
views
How to create a custom filed to upload a user profile pic/avatrar on the wp default register form? without plugin
I need a field that uploads the profile picture of the user-user profile picture who wants to register from the wp default registration form. so for that, Anyone, please help me with how to add an ...