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

Include User ID in iFrame URL

I seem to have hit a roadblock trying to figure out how to append the user ID to an embedded iFrame url address. I am using a third party app that tracks unique users (and invoices me accordingly). ...
0
votes
1answer
17 views

WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field

I need some guidance on making a wordpress posts query responsive to user meta data, and whether it’s possible to do what I want within the query itself, or if further work is needed in the database ...
0
votes
1answer
12 views

user metadata in json format, update the data partly only

Saving JSON data as meta_value for users in the wp_usermeta table. The JSON data looks something like this: { "user":5, "levels":{ "1":{"first_seen&...
1
vote
0answers
14 views

How to properly add a custom submenu to the user's admin menu

Firstly, I'm new. Assume that I know nothing! I'm writing a small plugin. Ultimately the goal of the plugin is to allow users to choose things that interest them from a few custom taxonomies, and then ...
0
votes
0answers
18 views

get_user_meta orderby meta_value

I have the following situation: Each time a specific action is fired, a custom-id + timestamp for that user is saved in the wp_usermeta. With get_user_meta i can output and sort the data visually ...
0
votes
1answer
21 views

get_user_meta value is stored within strange characters

I'm trying to access an ID stored within a user profile using the add_user_meta and the get_user_meta function to return the ID, but when I print the values out I am given this strange value. I can ...
0
votes
2answers
47 views

Shortcode to update user meta

I want to create a button on the front end and when user click, the value "user-meta" change 'validate' function func_change_validate() { if (is_user_logged_in()) { $current_user ...
0
votes
0answers
15 views

Using REST API for custom users registration / login and user profile displaying and search

I'm reading about REST API of wordpress and I want to use it to login and register users. I need to set the user role based on the user choiche and add some information before the registration is done....
0
votes
1answer
31 views

Update user role for expired membership

Is it possible to use a function in functions.php that would automatically change user role when a membership goes from status "active" to "expired" ? For example : if an active ...
0
votes
1answer
36 views

How is it possible to current user info on page in WordPress?

I am new at WordPress. I have need to display current user info on page: avatar, name, lastname, login... I have spent several hour on web, but could not find clean solution: How is it possible to do ...
0
votes
2answers
42 views

How to save multiple values with same meta_key, each value linked to another tag id

Let´s say a user signs up to multiple memberships, each on a different date. User signs up to: Membership A on 05.03.2021 Membership B on 17.05.2021 Membership C on 29.07.2021 I would like the dates ...
0
votes
1answer
64 views

Undefined variable: user_id in get_user_meta

I got the undefined variable : user_id when i use get_user_meta $phone = get_user_meta( $user_id, 'phone_no', true ); $icno = get_user_meta( $user_id, 'ic_no', true ); when i try put the above code ...
0
votes
1answer
30 views

Update user meta when customer update their first name

I want to update the user meta when customer changes their first name. here my code: add_action( 'woocommerce_update_customer', 'can_editable_account_count' ); function can_editable_account_count( $...
1
vote
0answers
11 views

How to replicate a user plugin made table value, to this user's custom meta table value?

I have a plugin that gets a value on user register and stores it in its own automatic made table. I need to set that same value into a usermeta custom meta_value, so the user will be able to see it ...
0
votes
0answers
17 views

Trying to add current user meta data to a shortcode and display an iframe on Wordpress

I created some custom user meta fields, which I can call normally and display the info added but when I'm trying to pass this meta value on to an iframe to dynamically generate an iframe based on ...
1
vote
1answer
40 views

How to check if a meta value has already been assigned to any user?

On my website I automatically generate an 8-digits random number $rndnr via wp_rand() during the registration process and save it as user meta. How can I check if this number has already been assigned ...
1
vote
1answer
21 views

Wordpress, fetching users with an exact match in a string of comma separated values in user_meta

I have data saved in user_meta -> areapref field. It is basically a string of comma delimited post IDs (e.g. 2, 37, 200, 300 etc.) I need to check if the user has a particular ID in this field. If ...
1
vote
1answer
15 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
22 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
23 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
26 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
160 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
103 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
22 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
42 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
235 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
250 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
27 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
67 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
26 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
34 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
20 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
24 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
16 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
104 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
42 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
81 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
30 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
27 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
94 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
89 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
17 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
24 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
25 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
136 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
43 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
2 3 4 5
17