Questions tagged [user-meta]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

Add custom input field in new user page

I need to have a custom input field in the admin page where wordpress give to an admin the ability to create manually a new user. Is there any hook that will give me the ability? If yes, will this ...
  • 5
0 votes
0 answers
8 views

Wordpress - Security Question at Login from User's Meta Data

How can I add KBA (Knowledge-based authentication) Field at the time of login in WordPress? That field can be anything submitted by the user at the time of registration. For example … At the time of ...
-2 votes
0 answers
20 views

Shortcode for displaying the user's first name?

Is there any snippet so that I can display the logged in user's first name only in a page/post using a shortcode. I tried various snippet from this forum, but they are not working.
  • 1
0 votes
0 answers
17 views

Group users by meta_value

i am trying to automatically group users when they register according to a list of selections in the register form. I am using WP User Group plugin to make groups and Ultimate Member to register users....
0 votes
0 answers
23 views

How to assign a custom gender to a user role?

I'm looking for a way to assign a custom gender I created to a user role. I have also created very specific custom roles for this, but for the example, let's say that I would like as soon as a user ...
  • 1
0 votes
2 answers
18 views

Unable to do WP_User_Query with meta filter

I have a user base of hundreds of users, and trying to create a custom API endpoint to get users in a specific membership group. The database structure is as follows (using Ultimate Member plugin): ...
  • 111
0 votes
0 answers
9 views

Wp admin: I need search meta key from table wp_usermeta in screen custom post type

In screen custom post type. Custom post type is: "phone_history_list" I have column: "name" → Value of column "name"display from field "meta_key" is "...
0 votes
0 answers
15 views

get user id from custom user meta key

I have a custom user key that is mobile I want to get the user id from that. $wpUser = get_user_by('mobile', $_POST['tel']); //return null $wpUser->ID the above code return null.
  • 191
0 votes
0 answers
10 views

Update user repeater meta (ACF) with another user meta field value

My goal is to get a signed-in user to select a color (saved in ACF user meta field group) that will be applied to another user meta field inside a repeater. the field must be the same for each row ...
  • 1
0 votes
1 answer
12 views

Display Additional Info

Hello guys, i have this problem. I added this additional field but i can't get the value for that specific field I'm using this code but shows nothing: ($field['type'] === 'cedula' && !empty($...
0 votes
0 answers
19 views

Create condition for Author bio Social Links

I made Social Links for Author bio Now, I want to make a condition that whenever Social is added, the <ul class="social-area social-area-2"> </ul> class should be created. If no ...
  • 1
0 votes
1 answer
37 views

Message notification for user

I want to create alert system for users. If user get message I want to show info andout it near user image in header. So I create table for message id_message | id_user | sender_name | sender_email | ...
0 votes
0 answers
21 views

Populate custom checkout fields with data from previous orders

I have created a few custom checkout fields using the WooCommerce documentation available here: https://woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ My ...
0 votes
0 answers
20 views

Ajax Favorite from foreach (how to specify which result result is processed)

I created my first ajax script which is an add-to-favorites option on my real estate site. On the single property page the setup works great...I check if the property is already saved, display a ...
  • 3
0 votes
1 answer
44 views

delete_user_meta from a foreach results page

I have a real estate site. On property pages users can save homes as a favorite. The property gets added to the user meta data. I can successfully add and delete entries from the single property ...
  • 3
0 votes
1 answer
60 views

Show/hide posts and categories based on user meta

I've added additional input fields to the user profiles with Advanced Custom Fields (for example "type of customer"). How is it possible to hide posts and categories for users with specific ...
  • 101
1 vote
0 answers
85 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
36 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
21 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
13 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
111 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
8 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 "...
  • 113
0 votes
0 answers
26 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
161 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 ...
  • 11
1 vote
0 answers
44 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
18 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
57 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 ...
  • 446
0 votes
1 answer
55 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
220 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
285 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
17 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
23 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 ...
  • 213
1 vote
1 answer
685 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
73 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 ...
  • 397
0 votes
0 answers
22 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; ...
  • 1
0 votes
1 answer
59 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 ...
  • 107
0 votes
0 answers
80 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( '...
  • 397
0 votes
0 answers
56 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 ...
  • 397
0 votes
0 answers
27 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
29 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 ...
  • 3
0 votes
1 answer
18 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 - ...
  • 143
0 votes
0 answers
16 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
49 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 ...
  • 3
0 votes
1 answer
36 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
100 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
34 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
509 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
37 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' =...
  • 203
0 votes
1 answer
39 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' )) ?> ...

1
2 3 4 5
18