Skip to main content

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
593 views

Advanced Custom Fields frontend form submission

I have made a front-end form that allows the users to set\update a few user meta fields made with Advanced Custom Fields (there are user preferences, mostly: dark\light mode, etc.). The preferences ...
Campioni Del Mondo's user avatar
0 votes
0 answers
39 views

Safely changing UserID's, re-using deleted UserID's and automatically using deleted userID's instead of an increment

I'm looking for 3 different solutions all relating to user ids, I'm needing a solution to safely make changes without destroying the site. Issue 1: I am wanting to change the userID of a user from ...
Ryflex's user avatar
  • 73
0 votes
1 answer
752 views

How To Export User's Custom Fields in CSV or XLSX

Hi Guys I have a BIG problem.. I'm using Eduma LMS and I have 2 type of customers... Some buy single video course, some others buy a membership (managed by Paid Membership Pro). When a user buy a ...
Mauro Langiu's user avatar
1 vote
0 answers
752 views

Updating User Meta with Array on Click of Button AJAX

I have an array on a front end page, and I am trying to update user_meta with the array via AJAX on the click of a submit button. I have come up with the following code, but I am having problems with ...
Edegist's user avatar
  • 133
1 vote
1 answer
884 views

How to update custom user meta field in wp?

I use the following to add and display new user meta fields on the user profile editor screen but when I click the update button, the values don't change: function extra_user_profile_fields( $user ) {...
rob.m's user avatar
  • 207
0 votes
1 answer
526 views

SQL - Shorter way to query user and usermeta data

I'm looking to query a bunch of user and usermeta data into a single table. I'm able to do so by creating multiple temporary tables and a pivot: create temporary table meta select u.ID, u....
user1061001's user avatar
0 votes
0 answers
602 views

User meta query using Wildcard

I have created a custom plugin which writes new user meta data. Each user has an array PER post so the meta_keys look like: custompostid eg: custom3456, custom4565, custom 3576 etc Each key holds ...
Shaun21uk's user avatar
0 votes
1 answer
309 views

Get user by meta key - WP multi site

I am trying to get a user by metakey: $user = get_users( array ( 'meta_key' => 'token', 'meta_value' => $token, 'orderby' => '...
gdfgdfg's user avatar
  • 162
1 vote
2 answers
15k views

Calling a method from functions.php on a click of a button

I have been working on a project where I will have to call a method(that accepts user id as an input) from a click of a submit button(Accept button). I have been trying all the ways but the real ...
Subham's user avatar
  • 27
4 votes
1 answer
4k views

How to get user metadata for social media url?

Does anyone know how to get access to user meta data on the wordpress backend? I'm trying to see if there is a "user_(linkedin, instagram, facebook, etc)_url". I'm working with a custom php ...
sansae's user avatar
  • 189
-1 votes
1 answer
3k views

How to change the value of a variable using input field?

I have created a wordpress website. I want to extract each user's data using php through his/her id. I have created this code; <?php $userid = /* help me get the below input field's value */ $...
Axmed nuur's user avatar
0 votes
1 answer
1k views

Display shortcode based on user meta

I have been working on a project where I want to display a shortcode based on the user meta data. I have added a user meta while creating a new user. The default value of the user meta is set to false....
Subham's user avatar
  • 27
0 votes
1 answer
4k views

Display current user metadata on Wordpress page

So I have a Wordpress website, and I want to be able to display the current logged in user's data on a page. Previously, I had been able to find a snippet of code that would go go in functions.php and ...
FAQ Tutoring's user avatar
0 votes
1 answer
3k views

Wordpress REST API and User meta data

I created two custom REST API endpoint to create/update a user metadata a get its value. I use update_user_meta() and get_user_meta(). Both work properly, in the API where I use get_user_meta() I have ...
enfix's user avatar
  • 103
0 votes
1 answer
299 views

How to get all multi-select user meta values and add them to an array?

I am trying to grab meta_values from a user profile's multi-select field, and convert them to usernames, which I will then input into an array. Let's say that the user has selected two options (out of ...
Michael's user avatar
  • 281
0 votes
1 answer
416 views

How to get user ID's from multiple usernames?

I am trying to produce user ID's from multiple specific usernames. The usernames are pulled from a profile field, and any number of usernames will be called. I want the user ID's from each of the ...
Michael's user avatar
  • 281
1 vote
2 answers
1k views

Hide menu item based on user's custom capability

I need to show one item from menu only for users that are logged in and have certain custom capability set. Is it doable from theme functions.php or does it need a custom plugin? Note: I already use a ...
toHo's user avatar
  • 200
0 votes
1 answer
681 views

Unusual high query of user meta data

We have a WordPress installation with many plugins installed. The site is not that highly frequented (maybe 10-20 concurrent users). I know the amount of plugins comes at a cost of performance. ...
ARAGATO's user avatar
  • 11
0 votes
1 answer
1k views

Update a user profile via frontend

I'm very new to WordPress so I have a simple beginner question. I've added some custom user fields on the admin form with the action show_user_profile, edit_user_profile, personal_options_update, and ...
Markus's user avatar
  • 123
1 vote
1 answer
5k views

Add custom user meta data

I want to add a custom meta data for all the users with a default false value. I have researched about adding a meta data i.e, add_user_meta( int $user_id, string $meta_key, mixed $meta_value, bool $...
Subham's user avatar
  • 27
2 votes
0 answers
388 views

Wordpress admin deleted user details not removed in database. How to delete WordPress Users from Database

When we delete a user from the WordPress admin panel it's removed, but the user values not deleted in the database. Anyone let me know how to fix the issue. ? What is the reason for this issue.?
Kanewilliam's user avatar
1 vote
1 answer
9k views

Filter WooCommerce Orders query with user meta data

I want to list orders from my Woocommerce shop. I have user meta for my users. (unsubscribed) I only want to list the order if that order's user is unsubscribed === 0. I have working code to the ...
landorid's user avatar
  • 113
0 votes
1 answer
160 views

Shortcode for Listing Users from Meta Value?

Trying to display a list of users that match certain criteria using a shortcode with parameters. Here is what I have so far, but for some reason it does not display anything. I am pretty new at this ...
Michael's user avatar
  • 281
0 votes
0 answers
1k views

How Can I Display the Last Modified Date for User Profiles on WordPress?

I'm trying to add a "last modified" date to user profiles on WordPress. I'm using the Ultimate Member plugin, so I would prefer to to find a way to save this date to a meta-key that I can pull when I ...
Michael's user avatar
  • 281
0 votes
1 answer
320 views

get_user_meta() in multiste with respect to subdomain

This code allows getting the number of points each user earned. function qa_get_user_point ($user_id) { return get_user_meta( $user_id, 'qa_point', true ); } The problem is that in multisite case, ...
Hamed's user avatar
  • 103
0 votes
1 answer
453 views

Updating user meta data from external link, user not logged in

My login process is exactly like this: 1- user put email in the form 2- a link sent to email for setting password 3- user click on the link and redirect to website with code like this: https://www....
zEn feeLo's user avatar
  • 207
0 votes
1 answer
105 views

Does meta-data need to be sanitized?

Is it necessary to escape data when storing it in the user's meta-data? I'm not sure if WP does this automatically, or if it is even necessary. Also, if it is necessary, should I use ...
logic8's user avatar
  • 101
1 vote
1 answer
130 views

Is there a way to append meta data without creating a race condition?

Our site has a lengthy AJAX function that appends content to the user's cart, which is stored as an array in the usermeta table. The function looks something like this: $cart = get_user_meta($userID,...
Pikamander2's user avatar
0 votes
1 answer
315 views

Get all user meta_keys and then group users by matching values

One of the plugins I am using generates user meta from our AD. One of the keys is the user's Manager. As many users will have the same manager, I want to be able to group all users. I was trying to ...
markb's user avatar
  • 299
2 votes
1 answer
668 views

Get users primary blog URL in MultiSite

I'm trying to get the primary blog URL of a user. What I have works to grab the details, but if there is more than one blog it just returns them all :( $user_id = get_current_user_id(); $user_blogs = ...
Jarod Thornton's user avatar
0 votes
1 answer
2k views

Delete all user's meta without knowing all the 'key'

Trying to delete users from the frontend - which I currently have working. Previously, I was manually deleting the metadata when it was completed. I was looking to see if it was possible to delete ...
markb's user avatar
  • 299
1 vote
1 answer
670 views

Custom SQL query on wp_users with the addition of wp_usermeta

I am trying to query a list of user id's in WordPress using SQL IN() with the addition of them having a meta_value value of "Yes" on the meta_key "is_registered" in the wp_usermeta table but I can't ...
mcmaster.1986's user avatar
1 vote
0 answers
93 views

How can I save unique user data on my site? [closed]

I am trying to find a way to allow registered users on my site create lists of data and save them. I'm having trouble finding a way to save the list they create to the database of my site. I am ...
kprogrammer's user avatar
0 votes
1 answer
165 views

Get user by meta data key and velue

I have create custom user meta, but it was array how i can call only one of them by key like I want to get only course_id = 22 list. Here this my user meta array [certifications] => Array ...
NewBle's user avatar
  • 1
0 votes
1 answer
760 views

Send admin new order email to logged in user as well

I need to be able to send the admin email for a new order also to the e-mail address linked to the current logged in user. This is required as 1 account is for different people (people who give a ...
BarrieO's user avatar
  • 89
1 vote
1 answer
615 views

Modifying Author Link to add Author Meta in URL

I have a plugin which adds a custom role called the trip_vendor. I am trying to edit or modify the profile url of this role. Currently, it is example.com/operator/username but I want to change it to ...
Asmita Subedi's user avatar
0 votes
1 answer
2k views

how to save multiple checkbox in usermeta and get it?

I want to create a new part as multiple checkbox in user profile page that user can check their services. But the issue is i do not know how to display the checked options after saving as checked ...
Sh.Dehnavi's user avatar
0 votes
2 answers
30 views

How can I add a simple custom field to my plugin?

I have a custom plugin that I'm trying to edit. I didn't develop the plugin. I just need to add a textarea to it and save the contents. I have the field added, but I can't get it to save. This simply ...
Lz430's user avatar
  • 137
1 vote
1 answer
69 views

Showing all users who match 2 meta fields with current user

PHP novice here... so thanks for your patience and generous answers in advance. I'm trying to show a list of all users who match two fields with the current user, but it's not working so I would ...
Phil's user avatar
  • 13
0 votes
1 answer
224 views

Where do I implement this display of User Meta Data, and how to put it in a table?

So I have the code below that should pull the user metadata of the currently logged-in user. <?php $current_user = wp_get_current_user(); echo 'Username: ' . $current_user->user_login . '<...
Ali Mosallaei's user avatar
0 votes
0 answers
804 views

wp_get_current_user Not working

I am using the wp_get_current_user() function inside a hook which fires before email is sent from contactform7 . The function works but the main problem is that the function doesnt return the current ...
sillyghost's user avatar
0 votes
1 answer
383 views

Updating WooCommerce product field when product author updates profile field

This is a continuation/variation on this issue: Adding existing user custom field value to a woocommerce product While this solution worked, ideally, it would be great if when the product author ...
Z Crow's user avatar
  • 13
1 vote
1 answer
497 views

Existing user_meta fields not updated

Why am I not allowed to update existing user-meta fields when hooking on to edit_user_profile_update hook? I use this code add_action( 'edit_user_profile_update', 'xpl_registration_save' ); function ...
hal's user avatar
  • 35
0 votes
0 answers
43 views

meta_query orderby sort multiple keys

I'm trying to read the birthdays of the users in my database through custom fields that have been added. Displaying the current months is easy but I am trying to capture the current month(remainder) ...
user3692010's user avatar
2 votes
2 answers
2k views

Add user custom fields and make editable on frontend

We are looking for a way to add Advanced Custom Fields data to a user / subscriber after they have purchased a product (Woocommerce). The subscriber should be able to edit these fields on the frontend ...
Benjamin's user avatar
  • 185
3 votes
2 answers
796 views

wp_get_current_user in custom file returns 0

I need to access logged-in user data in a custom PHP file that I call in a WP page through an include. The include file is: require($_SERVER['DOCUMENT_ROOT'].'/wp-config.php'); require($_SERVER['...
AnG251's user avatar
  • 31
0 votes
0 answers
253 views

How to update user meta from php file?

I need to update user meta from php file on my server. Maybe I need some additional permissions? <?php require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php'); $user_id = 1; $new_value = 'http://...
Johnny Dark's user avatar
0 votes
0 answers
60 views

WP author meta disappeared

My WP site has stopped displaying user meta data. For example, the biographical info has disappeared from both the front- and back-end. I've found it is still present in the underlying database: any ...
JohnG's user avatar
  • 334
1 vote
2 answers
110 views

I'm trying to update user meta but is always 1, What I doing wrong? [closed]

<?php function consultation_user_profile_fields($user){ if ( user_can( $user->ID, "subscriber" ) ) { ?> <h3>Consultation</h3> <?php $query = new WP_Query( array(...
pawel1993's user avatar
0 votes
1 answer
252 views

How to exclude posts for current user

How can I hide posts that are in an array of ids in the usermeta for the current user in the main query. I can use post__not_in in meta_query but I do not know which option to use for only a specific ...
Alex's user avatar
  • 15

1
3 4
5
6 7
18