Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
1 answer
16 views

How to use 2 different databases but share the same user in wordpress

I have 2 wordpress websites on the same server, one is bloo.com and the other is forum.bloo.com. each site has its own database, they have their own wp_content, each has its own file separately, but I ...
Mike's user avatar
  • 1
1 vote
2 answers
22 views

Include New Meta Field In New User Registration Email

I am currently using the below code to add some meta fields to my users and would love to include these in their registration email, but it appears they are not created before the email is sent. // ...
Matt Holt's user avatar
0 votes
0 answers
18 views

Problem with custom user fields default value and retrieval

I created 2 custom fields for users on my site, a Company name and a checkbox for whether a user has download access or not. Here is the snippet for the functionality: add_action( 'edit_user_profile', ...
Miroslav Kazimirovic's user avatar
1 vote
0 answers
21 views

add_filter( 'user_has_cap','my_function', 10, 3 ); and call to get_users in my function triggers an infinite loop in user list

I use: add_filter( 'user_has_cap','my_function', 10, 3 ); In user list to allow users to edit only a specific list of users with a meta user identical to a current user connected. To get the list of ...
Alejandro Antolinez's user avatar
0 votes
1 answer
36 views

Sort users in admin screen by meta value whether it exists or not

I want to list all users and order them by a meta value. Several users have it and some do not, but I want to be able to list them all and group them accordingly. I have the following code but it only ...
Badger's user avatar
  • 193
0 votes
1 answer
31 views

generate an array of user login date using update_user_meta();

I have begun to create a function to store last login date of user using time() function. Perfectly works! Now I want to store in a serialize array a list of all user login date. Question : Do I have ...
imagIne's user avatar
  • 83
0 votes
0 answers
19 views

Need some suggestions with Relationship fields and CPT/ACF

I am tasked with creating a Student/Teacher Portal where among other things, I need a way to build a way for Admins to assign Teacher with Students based upon Subject and Age group (Age for students). ...
RitZz's user avatar
  • 1
0 votes
2 answers
78 views

Is there a way that we can change wordpress user id?

I would like to ask if there's a WordPress plugin that can be used to modify the user ID of the user. Instead of 1 or 4, I will add a prefix like 387101 or 387104. If none, is there someone here in ...
Fonacier Jr. Balatero's user avatar
0 votes
1 answer
26 views

Administrator user cannot access dashboard after localwp import

This is the 2nd time this has happened in the past few weeks so I thought I would try and get some ideas on how to overcome. There are a few others in the localwp community that have had the same ...
php-b-grader's user avatar
0 votes
2 answers
11 views

Transform user name before displaying

Users are created whith name in upper case on my site, but some admin want to display it in lower case. I had a custom field in user profile to identified those admin, but I don't know what hook I can ...
Jean-Christophe Barrez's user avatar
0 votes
0 answers
11 views

How to add usermeta for existing users when user profile is updated

I need to add an usermeta field for users when they decide to modify some account informations on a custom form. At the moment I'm calling the wp_update_user() but since I want that the modifications ...
ICTDEV's user avatar
  • 133
0 votes
1 answer
33 views

Group users by meta field, with name of meta field as group title

I'm creating a employee photo directory based off users from my site. I'm trying to add front end filtering for this query and I have it mostly working. What I'm trying to accomplish is to sort the ...
NW Tech's user avatar
  • 707
0 votes
1 answer
28 views

Hide username from blog post source code

I discover some of failed login attempts on website i manage, some of it the attackers know the username who published the post, i looked into wp-json and it is not show or leaks anything. but when i ...
Yehia Gamal's user avatar
0 votes
1 answer
325 views

Retrieve Ultimate Member user profile given a WordPress user ID

I'm trying to write PHP code that loops through all WordPress users and fetches information out of their Ultimate Member profile. Looping through all WP users is the easy part and I have that covered. ...
kmoser's user avatar
  • 103
0 votes
0 answers
49 views

Short custom plugin to send email to users

I have created a very short plugin that is working with a cron job running the below function once every 3 months. I will explain the steps inside the function: Fetching Producers(a list of users ...
Honoluluman's user avatar
0 votes
1 answer
181 views

Add Additional Column in "Users" Dashboard Area - BP Extended Profiles (WordPress)

I have a site with extended profile fields. I can't find the particular way of adding an additional column as: Username | Name | Email | Site Role | Discord (this is the additional column) The ...
Shoaib Qazi's user avatar
0 votes
1 answer
16 views

Buddypress: "Auto load" specific usermeta in WP?

I have a Buddypress membership page, and for specific customizations I need a few usermeta fields being loaded all the time, for the currently logged user as well as (in case any) the displayed user-...
tim's user avatar
  • 154
0 votes
0 answers
38 views

Syncing Nickname and "Display name publicly as" by default

I have a form that allows people to update their display_name. However, this doesn't work. I'm using Bricks Builder with Bricksforge but none of their own platforms seem to get the right answer. So ...
Pixel's user avatar
  • 1
0 votes
1 answer
21 views

What is the equivalent of get_user_option for saving options?

In a custom plugin, I want to save user interface settings (e.g. which sections are expanded/hidden). From what I see, the get_user_option (docs here) function is perfect for retrieving the value. ...
hbit's user avatar
  • 230
0 votes
0 answers
112 views

How to set default value for fields added to user profile using ACF

I am adding several fields to the user profiles using ACF, example field setup with location set as user profile: ... array( 'key' => 'field_user_created_id', 'label' => '...
Rain Man's user avatar
  • 164
0 votes
1 answer
180 views

Can't display user bio

I have the ACADP listing plugin installed on my site. A registered user has a /user-listings/ page that displays all of his listings. I would like to display this user's bio on this page, but I can't ...
miksafro's user avatar
1 vote
1 answer
175 views

Query a meta key using an array of values where the database value is a string

If a meta value in the WordPress user_meta table is set as a comma separated list and not a serialized array, how can we compare an array of possible values to the values in the database table? ...
armadadrive's user avatar
0 votes
0 answers
59 views

Control page access based on User Meta data?

I want to control access to pages (and menus) based on whether the viewer has a value in a user meta data field. I've made a plugin that securely receives viewers from another private system where ...
Glen Little's user avatar
2 votes
2 answers
1k views

How to get custom user meta by id in custom Gutenberg block

As the title says, I just need to get user meta by the user ID in a custom Gutenberg block (editor side). Essentially what this would return in PHP: get_user_meta( $user_id, 'meta_key', true ); is the ...
Shoelaced's user avatar
  • 369
1 vote
0 answers
190 views

Problems with WP 6.1.1 and the get_user_meta() function

On upgrading from v6.0.3 to v6.1.1, the function get_user_meta() (used in my theme) is not working correctly! In the following code v6.1.1 returns $guid as an empty value, however when I revert back ...
Evan Camilleri's user avatar
0 votes
1 answer
164 views

MySQL query to list users who never signed in

What MySQL query can I use to get a list of users who have never logged in to WP? Some background... My WordPress website has been running since 2015 and initially, I had a newsletter form that would ...
Lazhar's user avatar
  • 183
0 votes
2 answers
43 views

A better way to write this php function

I have a function that has a few and/or operators in it. I'm sure there is a better way to write this but can't seem to figure it out. I thought I could use arrays but ran into an issue with having ...
protagonist's user avatar
1 vote
0 answers
194 views

Create Unique and Customized User ID for Website Members in WordPress

I want a Feature which can allow Custom User ID creation at Registration on WordPress. This will be different from the User ID that WordPress creates at Registration. This one is something that is ...
Gamicord's user avatar
  • 111
-1 votes
1 answer
57 views

How to display Author Profile based on Custom field value

I need to display additional author profile based on Custom Field Value. I am using native wordpress custom filed declaration. so for my custom field name is $coauthor = get_post_meta( get_the_ID(), '...
Bhargav Joshi's user avatar
0 votes
0 answers
115 views

Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the "users search" input box

Update: A solution for this question was provided byt @t31os_ here Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users ...
Johnathan's user avatar
0 votes
1 answer
587 views

Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users search" input box

I have been looking to extend the ability to search users in the backend for some time and have tried variations of several functions recommended in these articles and posts along with others not ...
Johnathan's user avatar
0 votes
0 answers
26 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....
Victor1290's user avatar
0 votes
2 answers
97 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): ...
harmjanr's user avatar
  • 109
0 votes
1 answer
13 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($...
ingenierodos neuromedia's user avatar
0 votes
1 answer
125 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 | ...
flytomoon777's user avatar
0 votes
0 answers
96 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 ...
Jayce's user avatar
  • 3
0 votes
1 answer
46 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 ...
Jayce's user avatar
  • 3
0 votes
1 answer
268 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 ...
Mario's user avatar
  • 101
1 vote
0 answers
201 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 ...
OverdueOrange's user avatar
0 votes
1 answer
64 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. ...
Line One's user avatar
0 votes
0 answers
95 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 ...
Robert Mifsud's user avatar
1 vote
0 answers
344 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 ...
naber brene's user avatar
2 votes
0 answers
693 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 ...
Appguy1's user avatar
  • 21
1 vote
0 answers
89 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 ...
FernandoTWE's user avatar
0 votes
1 answer
19 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; $...
Manoj Maurya's user avatar
0 votes
0 answers
313 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 ...
Brad Dalton's user avatar
  • 6,926
0 votes
1 answer
152 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, ...
jbonlinea's user avatar
  • 101
0 votes
1 answer
1k 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 ...
Vesna Mačković's user avatar
0 votes
1 answer
918 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 ...
David Wolf's user avatar
0 votes
1 answer
31 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 ...
sariDon's user avatar
  • 265

1
2 3 4 5
18