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

Why is my Custom User Meta deleted on Profile Update?

I have problems with my custom user fields on updating the user profile withing the /wp-admin/user-edit.php. The values of the huna and ki field are deleted. The validation and altUserID still show up ...
0
votes
0answers
8 views

Update custom user meta after recurring payment in wordpress [closed]

I have a custom user meta as Expiry date. So after every successful checkout the date gets updated to current date+24 hrs. How can I update that field again after successful renewal. I am using ...
-1
votes
0answers
17 views

User avatar sync between two Wordpress installation

I installed two WordPress site.com and site.com/blog. Two separate installations, not a multisite one! Also made the static.site.com as the media and uploads domain where all uploads are saved. I've ...
0
votes
0answers
23 views

Usermeta data unserialize, extract and display in table in Wordpress

I would like to know how to extract data from Wordpress, unserialize and show it in a table. Below is my starting point. The columns address, group and divider all have serialize data in. I have ...
0
votes
0answers
10 views

Custom bulk action with followup question/page?

I'm trying to create a bulk action to my User List page, but I do need extra parameters and possibly confirmation step. I know how to create a simple bulk action, but I need to set a specific ACF ...
1
vote
0answers
12 views

function to assign user role based on a field from usermeta

I need to get the content of a field in user meta role_type, and replace the actual user role based on the user selection. I use this function to replace the user role: add_action( 'user_register', '...
0
votes
1answer
20 views

Getting user data via ajax

I am trying to list registered users on the frontend which have a role of 'member'. I have a lot of advanced custom fields for the users though and don't know how to get those fields. I installed the '...
0
votes
0answers
10 views

how can I the get first name of user in menu?

I want to display the user's first name in the menu. How did I do that? Can I put any code in the 'Title' box in the Wordpress menu editor?
1
vote
2answers
38 views

Ensure function has completed before allowing another Ajax call

I am updating an array saved in a users meta field using an ajax function. The values added to the array are taken from the data-attributes within the tags which also act at the trigger to make the ...
1
vote
0answers
26 views

Updating wp_user_level on user update

I have the following code, which properly adds the wp_user_level of 2 when a new user is registered with the role "division_manager". I need the wp_user_level to be non-zero so they can be ...
0
votes
1answer
33 views

is_author(get_current_user_id()) returns false when author id and user id match

Inside the loop, when logged in to a localhost test site as $user->ID == 1 the function is_author(get_current_user_id()) returns false when get_the_author_meta('ID') returns 1. Thus, the following ...
0
votes
0answers
14 views

Add/Update grouped Meta Data with custom post type

I am working on this plugin where Download Plugin file: https://armorlube-my.sharepoint.com/:u:/g/personal/qasim_armorlubricants_com/Eae1VTKE3eRLkRq-qkP6yLkBdZSwDe1CIhyMUHn2lENuBQ?e=Q4U0PV I have a ...
1
vote
0answers
16 views

Authentication with the Rest API when using an External Application

Good day! I'm new to rest api. My task: to make authorization and management of user meta-information on WordPress. More specifically: I write games in html5 (in fact, this is a Java script), and I ...
0
votes
1answer
47 views

How to display content if user meta data isn't empty with shortcode

I need to display content if user meta data isn't empty Example : [empty_user_meta="last_name"] Show only if last_name is not empty. [/empty_user_meta] Code don't work : add_shortcode(...
0
votes
1answer
21 views

How to change the URL of sub menu page?

I'm trying to add a sub page under users in admin panel and everything works fine but I have a little problem when clicking on the created page the url changes and refer to my page as query string not ...
0
votes
0answers
12 views

Admin user column sort by numeric meta key

I try to sort a custom user field (team_user_id), I have all data but I can’t sort by numeric. updated code add_filter('manage_users_columns', [$this, 'custom_id_column']); add_filter('...
0
votes
1answer
18 views

Run Username SQL Query from WordPress Child Theme Functions File

Having an admin account, I can change everything except the username (which happens to be the login name). I am therefore wondering how to change the username using the functions file. Running the ...
0
votes
1answer
21 views

wp_redirect not working after update_user_meta

I have create a custom page to make users able to edit their profiles. every thing is OK but I do not know really why wp_redirect does not work??? . my edit-profile-proccess.php . <?php $user = ...
0
votes
0answers
15 views

Display the line breaks in user bio without using html

User fills their user bio using Formidable forms. It saves correctly and displays with line breaks in Worpdress admin on the user overview page. It displays without line breaks on the site. The only ...
0
votes
1answer
25 views

Get UserInfo from Wordpress

I am building a website and trying to pull the data from Wordpress using the WP rest api. On wordpress, the WooCommerce plugin has been added so the user contain more info and I have added additional ...
1
vote
0answers
17 views

Only view/edit/delete CPT made by users with the same role

I have created a custom post type (CPT) called "books" where users will be able to exchange "bookid" and "bookinfo" (as ACF). I have created user roles such as Countries ...
1
vote
0answers
11 views

Cluster CPT posts to users based on ACF value from their profile on dashboard

I have added an ACF in each user profile which contain a list of cities. Each user select a city he is in The goal would be that only people from the same city will be able to access the same posts ...
0
votes
0answers
20 views

How to do WP_User_Query for Nested Array value Inside Nested Array field

i am still new in wordpress development and try to playing with WP_User_Query right now. I have meta field, with this value: array ( 0 => array ( 'address' => array ( '...
1
vote
1answer
22 views

How do I create a column in Users list and display user data from custom registration field

Our registration form has a custom field for Hospital Name. In SQL wp_usermeta the meta_key is user_registration_hospital. I have tested a number of snippets in the functions.php file to add a "...
0
votes
1answer
59 views

Insert, update or remove data from database (usermeta)

I have a situation here. I'm writing a custom plugin for WordPress. I'm dealing with an issue: I'v created a metabox for Custom Post Type with add_meta_box and with a callback function where I ...
0
votes
1answer
40 views

How to keep users unique id stored in session in addition to IP in Wordpress plugin?

I want to get likes from two computers with the same IP in the post like plugin I developed for wordpress. Currently my plugin is working but when I like a post from a device with the same IP, the ...
0
votes
0answers
11 views

How to update user profile field on the checkbox change?

I have created a custom profile field in BuddyPress - single checkbox that is by default unchecked. I want to display this checkbox outside user profile settings page e.g. in the theme footer or ...
0
votes
0answers
18 views

Add/remove post ID to User Meta on the click of a button

I'm wondering if it's possible to update user meta via front-end, maybe with Ajax... The purpose is to create a custom user meta that stores post IDs that users set as "Add to list" or "...
1
vote
0answers
22 views

Update a costume wp_usermeta key back to 0 every 24hours (time can be specified as needed)

I'm new around here but I will do my best to get the question out as clear as possible. I'm developing a website where users will be able to publish portfolio items from the front-end of the website. ...
0
votes
1answer
47 views

How to properly use AND / OR in custom search

I have a text field and a drop down with country names. If I use OR and only fill in the text field with a person's name it brings back incorrect results. If I type in the name and select a country, I ...
0
votes
0answers
18 views

A specific User must select a parent post to publish a post

function wbg_custom_attribute($pages, $parsed_args){ global $wpdb; $user = wp_get_current_user(); //print_r($output); //print_r($pages); if ( in_array( 'translator', (array) $...
1
vote
1answer
61 views

What is the difference between get_the_author_meta() and get_user_meta()?

I am having an issue: get_the_author_meta() returns the meta get_user_meta() returns false for the same meta key I don't know why this happens. Regarding user metadata, when should I use one or the ...
0
votes
1answer
19 views

how add more field to wp user and save it to database

$creating = isset( $_POST['createuser'] ); $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : ''; $new_user_firstname = $...
1
vote
1answer
12 views

Prevent update of custom user profile meta field on the front end after 1st entry

I have an e-learning website that issues an official certificate of completion when a students complete their training course. The user profile name on the account can be used as the student name when ...
0
votes
1answer
13 views

profile_update works on second update only

I am using PODS to add info to a users profile. I want to add data to the usermeta then do something with it right away. One the fields created by PODS is 'estimated_delivery_date'. I have simplified ...
0
votes
1answer
16 views

Change user metadata on registration (show_admin_bar_front = false)

This is my first contact with WP Development, and I'm trying to not display the WP admin bar after the registration. Since it's metadata called 'show_admin_bar-front', I'm updating that right after ...
0
votes
1answer
37 views

Difference between last_name and user_lastname

As per documentation, the method get_the_author_meta() has a $field argument with the following possible values: admin_color aim comment_shortcuts description display_name first_name ID jabber ...
0
votes
1answer
17 views

Creating a custom post type upon registration for a specific user role

Can anyone help me to create a custom post type content when a new user is registered? But the user should be of specific role only. I have been searching but couldn't find any solution.
0
votes
1answer
32 views

get_results not returning anything

What is the basic way to use $wpdb and get_results? This is my code: global $wpdb; $q="SELECT * FROM wp_usermeta WHERE meta_key = 'nickname' AND user_id = 771"; $result = $wpdb->get_results($q); ...
0
votes
0answers
11 views

wait for DB to finish before reloading page

In my account page I have some PHP logic going on along with update_user_meta. The status of the user meta depends on what the page will display. The problem is that page refreshes before the ...
0
votes
1answer
34 views

Restrict Access to Posts based on Custom User and Post Meta Data

I have a custom Post Type called Club Pages, and a custom role called "Club Leader". Club Leaders currently can only read, modify, and delete all Club Pages posts. However, there are many different ...
0
votes
1answer
26 views

get_user can't read variable

I have this little routine to find the user_id based on a usermeta field.. $scaleData = json_decode($reading, TRUE); $deviceid = $scaleData["imei"]; echo $deviceid; // check to confirm is working. ...
0
votes
1answer
14 views

How to search usermeta table

What is the best way to search usermeta to find a user_id based on a meta_value? For example in usermeta table there is a row with user_id = 123 , meta_key = deviceid and meta_value = 45545. I know ...
1
vote
0answers
35 views

How to upload a file to a folder named after the user_id via plugin

I'm trying my hands at my first plugin, nothing fancy just want to grab the user_id, create a folder for each user and let the user upload an image. I know my code can't be completely wrong, because ...
0
votes
0answers
26 views

Move Non-WordPress users table to WordPress database

I'm new to Wordpress. I have a users table for my non-WordPress site. Now I want to move my site to WordPress but I have few doubts - Usually, We can transfer tables by exporting as a CSV file and ...
0
votes
0answers
28 views

How can I list users by date in an array in meta_value?

I keep an order list of all users. I keep this list in the meta_key value named payments. The payments meta allows me to keep information about the payments the user made. To give an example for an ...
0
votes
0answers
13 views

Hooking into profile_update does not provide the new user data to my function

I am making a plugin to push changes in user data to an API every time a profile is updated, be it by the user themselves or from the backend. To do this I am hooking into the "profile_update" action. ...
1
vote
0answers
23 views

Should I encrypt the response that triggers an Ajax action? Is nonce sufficient?

I am trying to write a custom user registration plugin. The plugin has 5 basic functionalities Take form data and create a user using wp_insert_iser Once a user is created, update user meta for ...
0
votes
1answer
40 views

Saving user meta “member_id” based on user role

In a WP / Woocommerce with subscriptions plugin environment I manage to save in the user meta table a custom "member_id" at the user creation level: function assignuserid($user_id) { global $wpdb;...
0
votes
1answer
74 views

Uncheck the box “Send User Notification” by default on new-user.php

I'm looking for a way to uncheck the box by default when we create a new user on WordPress. Right now it is checked when we access wp-admin/user-new.php like you can see on the screenshot below: ...

1
2 3 4 5
16