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
1answer
15 views

How do I update user email from frontend input field?

I'm using the below function which is working for my phone and address fields. I can't seem to change the email though... any idea what I'm doing wrong? function um_modifications_callback() { // ...
0
votes
0answers
21 views

How to get metadata (in my case mail) of users who have a certain set of metadata?

It's a really hectic day for me. Okay, I need to choose all users with some role, with and with some meta_data: subscriber, user_country, and user_sector for example. In the beginning, I have several ...
0
votes
0answers
30 views

How to get data from user meta custom fields created with acf-pro plugin?

I need to get user meta from the database and WordPress has the awesome function get_user_meta() for this purpose but, the problem is I need not default meta field. I need to get data from a custom ...
0
votes
1answer
20 views

Getting users with a specific meta data and then querying their posts?

Basically what I want to do is first get users with a specific meta_key and meta_value. And then query their posts. Right now I'm using this: <?php $user_ids = get_users([ 'meta_key' =...
0
votes
0answers
12 views

Reading additional fields in PMPro

I am currently working with PaidMembershipsPro, so I wanted to simply add a field with a phone number using register helper and check if the phone number has already been registered on the website. To ...
0
votes
1answer
13 views

Combining wp_list_authors with get_user_meta

i am using the wp_list_authors function as the following: <?php wp_list_authors( array( 'show_fullname' => 'true', 'orderby' => 'display_name', 'order' => 'ASC' )) ?> ...
0
votes
1answer
43 views

Wordpress update_user_meta onclick button with Ajax

I have a button that is limited to 7 clicks, when clicking number 5 is disabled, My problem if the user login from different device, the count start againg in 0 same as refresh page. my needs is, Save ...
0
votes
0answers
13 views

How to display user_meta array as a table?

Ok, so I'm building a "Transactions" table for a user using user_meta array. I'm new to this and trying to figure things out. Basically, in practice I know how to store array to user_meta. $...
0
votes
0answers
18 views

Disable link after click by user meta data using js and php

I am working on a member site with a link, that after clicked, js will disable it. I would like the link to remain disabled permanently for the user after one click. I created php code that checks new ...
1
vote
1answer
27 views

get_the_author_meta( $field, 0 ) returns the administrator $field

Just discovered that the get_the_author_meta( 'birth_date', 0 ) returns the administrator birthdate. The same happens with other $field parameters for $user_id = 0. Is this an expected behavior for ...
0
votes
0answers
48 views

Change auth_cookie_expiration for specific roles and specific login times

In my db i have a login counter that keeps a number value as a record (1,2,3,4,5...)every time a user from a specific role logins. I am trying to change the auth_cookie_expiration to 1 day for ...
0
votes
1answer
101 views

How to add fields in custom registration form, validate it and aave to db? [closed]

I use a WP theme with a custom registration form. I want to add two fields to it (for phone number and company name). What to add to the php file of the form and what to the function file of theme ...
0
votes
1answer
56 views

Users table missing from Database [closed]

I have a functioning WordPress site, with two users (an Administrator and an Editor). I can log in to the WP back-end fine with either user. I can create pages, etc. But when I look at phpMyAdmin, ...
0
votes
1answer
42 views

Best Practice? - Saving multiple Values as Serialized Data / Saving each Value per Row / Dedicated Table

For each user the following is to be saved: user_id tag / tag_id (eg. 1,2,3,4,...) timestamp first_seen (for each tag) timestamp last_seen (for each tag) Options which come to my mind: One Row ...
0
votes
0answers
12 views

how to create variable like this %user_posts_page% or like this {user_posts_page}

I am tryiing to create variable like this %author_posts_page% or like this {author_posts_page} to use with Wp user avatar plugig to generate profile link for user avatras. But this not work for me. $...
0
votes
1answer
12 views

How to add and subtract user meta values after post meta update

Basically, I'm trying to make a point exchange between current user and author when the post meta value is updated. As well as add +1 to post meta. Here's what I currently have: // Coin exchange ...
0
votes
1answer
29 views

How to update and save user metadata on page visits?

Basically I'm looking for something like this: <?php if ( is_page( array( 'home' ) ) ): ?> update_user_meta( $user_id, 'pagehome', '1' ); <?php else: ?> ...
0
votes
0answers
11 views

upload image to specific folder by users

on my website i let users upload their profile image. at this moment they can upload their images and every thing is functional. the only problem is that their images are saved under /wp-content/...
0
votes
1answer
20 views

cannot get user_registered date from get_user_meta

I am trying to display the user_registered date from get_user_meta but it always displays as empty. If I try another field I do get a value so not sure why I don't see anything for the date. If I ...
0
votes
0answers
58 views

How to create a custom filed to upload a user profile pic/avatrar on the wp default register form? without plugin

I need a field that uploads the profile picture of the user-user profile picture who wants to register from the wp default registration form. so for that, Anyone, please help me with how to add an ...
0
votes
1answer
17 views

How to get user meta fields that have just been updated?

I am trying to update a BuddyBoss Profile when a users wordpress profile is updated in the user edit page from the backend/admin. (Basically I want to sync the data). I have this function: function ...
1
vote
2answers
16 views

Wordpress User Meta & ChromePHP or other way to debug/view php variables

I am developing a plugin to extend BuddyBoss platform. Specifically I am sync'ing BB user info with Wordpress User meta data. Most of my code works (country and regional organisation update fine), but ...
0
votes
1answer
34 views

Change user meta value with shortcode

With shortcode, i want to create form to change the car's name of user function wp_change_namecar( $atts, $content = null ) { if (is_user_logged_in()) { $user_id = get_current_user_id(); ...
0
votes
1answer
233 views

meta_query for a string inside a meta field containing a comma-separated list

In my project the WP users have a custom meta field "usergroup" containing a comma separated list of values. The meta field can contain values like this: WS,CT,IS,TS,TS-IS,TS-WS,TS-CT Now I ...
0
votes
0answers
13 views

Hide users on users.php with a specific meta value

I am using the User Switching plugin in order to allow sales agents to place an order on behalf of a customer. I want to allow sales agents to switch into their customers only instead of all customers....
0
votes
1answer
511 views

WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]

I'm hoping someone can't point me to what I am overlooking. CIRCUMSTANCE: We have some unique business logic whereby a custom user meta field affects the appropriate tax class. We have three customer ...
0
votes
0answers
12 views

Can I add a unique code for each user based on the location?

I am trying to create a unique code for each user based on the location he/she adds when registering. For example: User from UAE: 971-0001 then a user from Egypt: 020-0002 Can this be done? Thank you ...
0
votes
0answers
28 views

How can I search user meta by a partial key name?

Im setting up a section in a user account where the user can block off certain days, right now its adding the meta as follows unavailable-days_1: ["16/06/2021"] unavailable-days_2: ["18/...
1
vote
0answers
54 views

Is it safe to delete unnecessary user metadata?

I'm having performance issues with my Wordpress site, due to the number of registered users, the wp_usermeta table has almost 70 million rows. Users do not have access to modify their profile so I ...
0
votes
1answer
47 views

How to combine two get_users() array?

The $q1 and $q2 are working well individually. if (!empty($search_term)) { $q1 = get_users(array( 'fields' => 'all', 'role' => 'contact', 'search' =&...
0
votes
1answer
20 views

Counting instances of words in the results of a post query

I'm way over my head with this one and wonder if anyone can shine a light on where I'm going wrong. I am grabbing some authormeta for the resulting posts of a query, and I want to tally up the number ...
0
votes
1answer
30 views

how to get users with usermeta include array of an array

i have a user_meta for users that them is array like below: user_saved_posts = [31289,31482,27641] and i want to get users that their user_meta include an item of an array like below: goal_posts = [...
0
votes
1answer
67 views

Get user meta for only the keys with a certain prefix

There is a list of meta keys with the prefix my_theme, these are updated by the user. My problem is how to get_user_meta for only the keys with my_theme prefix. Tried a wildcard, didn't work. ...
0
votes
0answers
8 views

Query posts according to previously selected categories of logged in user

How do I query posts according to categories that a user selected at registration? The posts would be from a custom post type and match with existing post categories + custom field categories from ACF ...
0
votes
0answers
10 views

My custom user metadata is only active for only admin but i want it to be active on all users especially customers

How can i make custom user metadata which is only active for only admin be active on all users especially customers. Attached are snapshots of the issue.
1
vote
1answer
30 views

How to get a list of all possible values of a specific user meta key?

I have set up my posts with bookmarks where the user's meta will be updated with the post ID of the post they are bookmarking. They are stored in user meta key my-bookmarks as an array. Now I am ...
0
votes
0answers
52 views

How to get image path from id using SQL

I want to use a SQL query to get some random users and display an advanced custom fields profile image. Currently with this query I get the image ID back but I somehow from that need to get the url ...
0
votes
0answers
11 views

user_metadata saved but deleted just before display the page

I made custom user fields on wp-admin/user-edit.php?user_id=42. For some reasons, two fields cannot be updated but I can modify an another custom user field which had already a value. I did a load of ...
0
votes
0answers
54 views

User meta needed in query is serialized - how to unserialize safely?

I'm a complete newbie to php, and I'm trying to use a function suggested by FacetWP to pre-select the post results shown to users. (I'm using this method, rather than pre_get_posts as I want users to ...
0
votes
0answers
56 views

How to set a limit of a taxonomy term

I am seeking to allow an admin being able to set a varying limit of users who can be added to each user taxonomy term. The user taxonomy term is selected when adding a new user from the user edit page ...
0
votes
0answers
36 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
2answers
27 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
31 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
15 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
25 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
69 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
36 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
91 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
37 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 ...

1
2 3 4 5
17