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
22 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
10 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
7 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
  • 113
0 votes
1 answer
27 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
  • 717
0 votes
1 answer
23 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
110 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
45 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
42 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
15 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
23 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
16 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
  • 210
0 votes
0 answers
68 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
  • 145
0 votes
0 answers
19 views

Pending posts showing category until published

I have used ACF Pro to setup post types Award "Categories" and "Nominees" -- Award is being assigned to the post but while it’s pending it's not showing up here https://a.cl.ly/...
Daniel Finch's user avatar
0 votes
0 answers
19 views

wp_user_query with meta_value_num for leaderboard

Context : I try to make a custom leaderboard with the WP_USERS_QUERY class and the custom code below. I use the gamipress plugin for points system. The leaderboard works fine, displaying correctly the ...
Megayamori's user avatar
0 votes
0 answers
55 views

How to update my jquery/PHP function to add/remove user as favorites in (WordPress) users list

I have a WordPress website in which I list down all the users (based on MemberPress subscription), and users can save other users as favorites. The function works well when saving a user as favorite, ...
Bart's user avatar
  • 1
0 votes
1 answer
112 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
0 votes
0 answers
11 views

Export user data from Squirrly’s Starbox plugin?

I'm using the Starbox author box plugin and have been since I started adding authors as users. I now have around 800 users. When I deactivated Starbox to use a different plugin, all of the user ...
Serena Z.'s user avatar
1 vote
1 answer
120 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
40 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
725 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
169 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
114 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
152 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
48 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
93 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
422 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
23 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
81 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
101 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
93 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
234 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
183 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
58 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
77 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
289 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
1 vote
0 answers
534 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
  • 11
1 vote
0 answers
76 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
266 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,896
0 votes
1 answer
127 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
0 votes
1 answer
947 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
800 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
28 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
  • 255
2 votes
1 answer
3k 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 ...
David Wolf's user avatar
0 votes
2 answers
144 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 ...
Foysal's user avatar
  • 417
0 votes
1 answer
160 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 ...
Ben Blue's user avatar
  • 117
0 votes
0 answers
89 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( '...
Foysal's user avatar
  • 417

1
2 3 4 5
18