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
0answers
6 views

Custom column in user table displaying total comment count

I need a custom column in the user table displaying the total comment count of approved comments of each user. I know how to do this using a plugin, but I would rather use a snippet in the functions....
0
votes
0answers
14 views

How to get a list of users who like a current wordpress post & remove post dislike & comment like/dislike system

I have the code, the code working fine. But i want modified somethings. //function file add_action( 'wp_enqueue_scripts', 'sl_enqueue_scripts' ); function sl_enqueue_scripts() { wp_enqueue_script(...
0
votes
1answer
25 views

How to order custom fields in the user profile (admin area)

I’ve added a custom section to the user profile in my own theme. The section is called „Extra Profilinformationen“ for now and includes a field for twitter. It’s added to the bottom. Is there any way ...
0
votes
0answers
12 views

Is there a way to pre-populate an ACF Form with existing data when creating user meta data on the front end? [closed]

I have a field group that I created, which I am using to create a form on the front end of my site so a user can update meta data tied to their own profile. I am using this function to print the form,...
0
votes
1answer
19 views

User updating their profile wipes my custom fields

I have created a plugin to add extra fields to user profiles. These fields can only be edited buy admin and do not show on the user'profile page. The extra fields are shown and can be edited by admin. ...
0
votes
1answer
19 views

get_users / WP_User_Query returns empty when logged out

I have a fairly basic user query pulling staff members on a website I'm working on. When you are logged in to WordPress they are showing on the front-end. But when logged out they are not displaying. ...
1
vote
1answer
11 views

Save User Meta Email Address in Lowercase

I'm looking for a way to save all email addresses to user meta as lowercase, ideally without validating and asking the user to change it but instead just saving it as lowercase. I've got as far as the ...
1
vote
1answer
16 views

Get list of taxonomies associated with Subscribers

I used this tutorial so that I would have the ability to associate categories with users. However, I changed the code so that it would show only on Subscribers profiles (not Authors like in the ...
1
vote
1answer
28 views

User last login and user last visit problem

Need some help with debugging. I have two function is functions.php One to capture user last login function user_last_login( $user_login, $user ) { update_user_meta( $user->ID, 'last_login', ...
0
votes
0answers
17 views

Meta_query on same meta key, with diffrenct values

i'm trying to get_users with the meta_query where i need to find users where either they don't have the meta key, or it is blank. It seems like everywhere i look, i should be able to use the OR on ...
1
vote
0answers
22 views

Dynamic URL based on user_metadata

I want to know how can I dynamically change the page a user is taken to when they select a URL....using wordpress user metadata fields? My users have either selected "male" or "female" as their ...
0
votes
0answers
115 views

Create user with ACF custom fields via REST API

I'm unable to create a User via the WordPress REST API when I include custom fields within the payload. I have 2 custom fields on the User object, created with ACF: phone_number (string) state (...
0
votes
0answers
18 views

Store data from JavaScript object to custom table in user account

When a user is logged into WordPress, I want to be able to store data coming from a JS query into a custom table of the user in WordPress. I want to show this data when the user goes to their user ...
1
vote
1answer
31 views

How would you update a frontend form with AJAX

I'm trying to build me own frontend AJAX updating screen mirroring interface. I have a very basic form: <form id="mblocation"> <input type="radio" name="mb_user_location" id="...
0
votes
0answers
14 views

add image uploader field for users without plugin

i have made signup form in custom template. I'm trying to allow users to upload a profile image on their user profile editing page, thanks in advance. kindly help with code step by step. i have ...
0
votes
1answer
19 views

Show extra user profile meta for current user

I tried to add extra user profile fields. After that I want so show these extra fields using a shortcode. I have added the following code to my functions.php file to add the extra fields and save them ...
0
votes
0answers
22 views

How to extend the WP_User class with wp_get_current_user()

So typically when I want to get a new user object in WP I do something like this: $user = wp_get_current_user(); The default user class is nice...but it would be handy to give it more functionality ...
0
votes
0answers
16 views

Hook into form handle from admin users table

I'm adding a couple of buttons to the user table in a custom column, in which, on click will need to either approve or reject the user via update_user_meta. I've tried hooking in with profile_update,...
0
votes
0answers
44 views

searching for posts, with user meta parameters

I try to show posts for all registered users. The users have some user_meta fields, that i can display suggested posts for them. I have exact the same function in use on the profile page of a user, ...
0
votes
1answer
29 views

Displaying field value in new column in users view on wordpress

I have never developed a Wordpress site to this level before. One of my plugins introduces security questions for the user at registration time. I only have one question. In the backend, when admin ...
0
votes
1answer
44 views

Updating User 'Description' Meta Data (not working as expected)

I'm creating a form to allow users to update their bio ('description' metadata) on a custom profile page. Current values are successfully retrieved and new values are being stored to the DB, but with ...
0
votes
1answer
21 views

Pulling member name from WordPress URL

I'm trying to retrieve user information based on a URL within WordPress. I've setup a page template for each of the WordPress users on the site. I'd like to say "contact userfirst userlast" and ...
0
votes
1answer
17 views

Hook into add_user_role and update based on new and removed roles

I need to add user meta based on each role added and removed. I tried to achieve this by hooking into add_user_role and looping through and updated list of user roles but the old ones are still ...
1
vote
0answers
22 views

get_user_meta an ID for multiple functions

i created an frontend profile for users, where they can add some informations to there profile. All the infos are stored in the usermeta. To show these informations on the frontend profile of the user ...
0
votes
1answer
21 views

How to prevent multiple user accounts with the same meta field?

I run an ecommerce site on top of wordpress. There is a particular meta field that users fill out when they checkout with me. Let's say it is the address of the user. I would like to setup my site ...
0
votes
1answer
20 views

If Array Values Match Another Array's Values, Then

I have a user drop-down field that includes High, Medium, or Low ranking. Each ranking has three requirements for evaluation types. I also have three additional drop-downs with options to choose ...
0
votes
0answers
30 views

Export Wordpress User Meta to CSV/Excel

I have shops and consultants both set up on Wordpress as users with different roles. I want to include an "Export" link on the consultants' profiles using a shortcode that will export the shops on ...
0
votes
0answers
16 views

How to get user meta data (e. g. name, phone) into a table?

How can I create a table that includes user data from user profile like 'Name', 'Phone number', 'Address' and custom fields like 'Note', 'Admin comment'?
0
votes
0answers
66 views

Get user count based on multiple meta key values?

I am trying to count all of the users meeting multiple criteria. I have tried so many different things and cannot get it to work. Any help is much appreciated. Thank you. add_shortcode('...
0
votes
0answers
21 views

Updating User Profile information removes image

I have a custom front end user profile form. When updating the profile without changing the profile's image it will remove the image. You have to reupload the image any time you update your user ...
0
votes
1answer
46 views

Why get_users() not working on the admin backend?

I can't figure out why get_users() works on the frontend but not on the admin backend. I'm sure this was working at some point. My code: function add_new_user_menu_item() { remove_submenu_page('...
0
votes
0answers
12 views

How to update user_meta_data from frontend

I want my user to be able to choose if they are a company or individual I've made a user_meta_field in database and it works fine, but how do i make some sort of option on my page-profile.php template,...
0
votes
1answer
39 views

Custom Field Repeating When Using foreach

I'm trying to display user avatars by login user name using custom fields like this - And here's the code - function user_avatar() { $name = get_post_meta( get_the_ID(), 'user_name', true )...
1
vote
0answers
73 views

transition_post_status not working via Quick Edit

I am trying to use transition_post_status with custom post statuses to update user meta each time a post status is updated. The following works when editing the post status in Edit Post Screen, but ...
0
votes
0answers
11 views

How to force website flow based on user metadata by showing/hiding elements?

I've built a website with Elementor Pro and Gravity Forms Elite and created custom user metadata True/False flags using update_usermeta() in the functions.php file and would like to force user's down ...
1
vote
1answer
17 views

Assign a role to the user who registers on a form

I created a registration form where I integrate Stripe for payment. Everything works correctly and I was also able to create the wp_users and wp_usermeta table in the database. The only thing I can'...
0
votes
0answers
9 views

How to Moderate Edits to User Profiles?

I would like to moderate WordPress users’ edits to their own profiles. As I understand it, the default would be for the profile changes to go online immediately. Instead, I’d like to leave the older ...
1
vote
1answer
31 views

Calling a function from anywhere, used in different places

I have a function that is currently operating correctly. It is currently located in the 'My Account' section and is working as it is supposed to. Changing user meta info in the back-end fro a drop-...
0
votes
1answer
26 views

User Meta Value not echoing despite Var_Dump Showing correct string

I am going absolutely insane with this one, I cannot for the life of me figure out why I am not receiving the string content. var_dump is outputting the correct result perfectly, yet the content for $...
0
votes
2answers
26 views

Edit a user profile field on front end

I have a user profile field that I would like to allow users to edit, but I have the backend dashboard/profile disabled. If I only know the meta (dbem_paypal_account), how can I make this work? I've ...
1
vote
1answer
67 views

Can I set user meta for theoretical user 0?

I have a use case where I need to store user_meta for all users including guests. It is just one fairly complex array to deserialise into one value. My instinct is to try and store an array of guest ...
0
votes
1answer
38 views

Change/Set Page Title and Meta Tags from Page Called within a Plugin

I'm using a set of query vars and rewrite rules to load a new page. My final call to the page looks like this: add_filter( 'template_include', 'se343855_template_include', 50 ); function ...
0
votes
0answers
61 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 ...
0
votes
0answers
15 views

Check custom User meta before Insert

My goal is to check if my custom user meta field 'subscribe_to_newsletter' has been changed. If so i will be sending an API call to mailchimp to change the users status. I currently have a front end ...
0
votes
0answers
33 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 ...
0
votes
1answer
42 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 ...
1
vote
0answers
38 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 ...
1
vote
1answer
31 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 ) {...
0
votes
1answer
32 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....
0
votes
0answers
17 views

Add user tag to corresponding custom posts

I use The events calendar plugin as a timetable for scheduling staff. Each event (custom post) represents a shift. Each event title (post title) is named after the particular employee of that shift (...