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

How do I display a user's previous orders as a select box option on a product?

I have an audio customization site (Wordpress/Woocommerce) that allows users to purchase licensed music in either an 'as-is' state or a customized version of it. The specifications of a customization ...
0
votes
0answers
19 views

Create user meta that can define key value

My problem: I am using WooCommerce. And I want each user to be able to define an extra attribute for the products. This attribute will be used to calculate the price of the product. I already have the ...
0
votes
1answer
20 views

Join Query on WP_USERMETA Table

I want to check if user time zone is perth and its belong from Group A. MY QUERY IS NOT WORKING SELECT * FROM `wp_users` AS t1 LEFT JOIN wp_usermeta AS t2 ON t1.ID=t2.user_id WHERE t2.meta_key='...
0
votes
0answers
11 views

Sort users list (admin area) by ACF post object/relationship title (not by ID)

I have custom fields for users for example "City". And "City" is a custom post type and in ACF it's using for users as a Relationship/Post object. And if in Users page sort by City ...
1
vote
2answers
45 views

set a user-meta key as avatar

i have a user-meta kay named "avatar"; This value contains the URL of the image that the user upload. how i can to set this meta value as user avatar? i use this code and not work add_filter(...
0
votes
0answers
27 views

Invalid user ID for all users

Not sure what is going on with my bedrock install, was trying to update a user role using the wp-admin panel, it refused to update, so I logged out and now I can't log in as admin or user. Invalid ...
0
votes
0answers
17 views

Delete user meta ( delete_user_meta ) by key without user id

I am new at WordPress. I am not sure is it possible or not that if I want to delete user metadata by passing the only key. for example: delete_user_meta( $key ); But looks like required a user id. Is ...
0
votes
1answer
24 views

Conditional editing CPT - using editor's role and author's usermeta

I have created a custom post type. Each author is attributed to a editor group when her/his account is created. This is save on the author's user meta I created two roles with administrator ...
1
vote
1answer
36 views

adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again

I am developing a wordpress theme for themeforest so its for commercial use and adding a custom input field of social media to the user menu in the WordPress dashboard gives error after i click Update ...
0
votes
2answers
59 views

Update user meta through a front end form

I've made a form on WordPress theme frontend that let registered user change some of their user metadata on page, but it didn't work, code like below: <form name="update_basic_user_meta&...
1
vote
2answers
99 views

'profile_update' hook alternative for WooCommerce user meta data

I am trying to get all user details (including WooCommerce meta data) in a function that is called with user_register and profile_update hooks. This is the simplified code: function get_all_user_data($...
0
votes
0answers
22 views

check metadata in wordpress

When I made the registration form, I received the contact number from the users and saved it to user_phone Meta_key with the update_user_meta function to the wordpres database. Now I have trouble ...
0
votes
1answer
66 views

JS POST update data taxonomies

How can I call the value of each term with my js function? I need use a Array not just ` useractivities=[]; $('.user_activities').each(function(){ useractivities.push( $(this)....
0
votes
1answer
21 views

Using WP for user management

I want to use Wordpress for the user management of a simple web app. What I really need to do: Check if a user is logged in Save meta data to a logged in user Read meta data of a logged in user ...
0
votes
0answers
25 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
31 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
18 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
14 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
22 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
13 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
52 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
36 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
49 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
22 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
24 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
69 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
48 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
16 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
20 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
23 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
2answers
32 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
39 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
19 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
12 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
23 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
23 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
136 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
53 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
23 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
21 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
25 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
49 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
124 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
19 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
16 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
23 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
52 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
21 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.

1
2 3 4 5
17