Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [user-meta]

User meta data consists of key-value pairs pertaining to the according user ID.

1
vote
1answer
27 views

Adding current user's ID to the end of PDF hyperlinks in post content

How can I add extra parameters after a hyperlink, for tracking purposes? For example, let's say I inserted media into a post - http://mysite/wp-content/uploads/2018/12/My_PDF_File.pdf. How can I make ...
0
votes
0answers
11 views

Advanced Custom Fields add custom fields in user meta table after user is created [on hold]

How do I create programmatically using Advanced Custom Fields Pro on a new user new entries for profile data over ACF? Getting to the point of creating a new user by a script I want to be able to ...
0
votes
0answers
13 views

update ACF user metas programmatically [on hold]

I use woocommerce where I have a custom hidden field on checkout page which is populated by a survey. Each user has some user metas created over ACF and I would like to add this hidden data to ACF. ...
0
votes
0answers
17 views

Function not updating user_meta correctly when $current_time triggers

Hi all, I'm having trouble with my logic for the following function. I cant seem to make it work when it is supposed to, and how to override it when it is authorised to. The aim of the function is: -...
0
votes
0answers
7 views

connect woocommerce custom field to wp user meta upon customer registration

I'm adding a custom field on my woocommerce registration that actually saves customer IG usernames by using this code below placed on my child theme's function.php file: function ...
0
votes
0answers
13 views

How to do a sql like query on serialized data of user meta data

As long I don't need to do a query with the data of all users, storing data like the zip code or city in the meta data as an serialized object works fine. But now I have to do a lot of different ...
0
votes
1answer
18 views

Update an additional user meta field with a string

I have created a WordPress website. In the user section I have created an additional attribute called "Token" meta field. Every time a new user is created or a user logs in and is validated, I would ...
0
votes
1answer
16 views

How would I be able to use a font awesome icon as a user's avatar?

Would it be possible to use/allocate a font awesome icon as a user's avatar?
0
votes
1answer
16 views

Auto copy value from specific user meta field to another field

I'm looking for synchronizing specific user meta field with another one. ex: Coping user phone number to woocommerce billing phone. So the admin can only edit one field and the other updates ...
0
votes
1answer
23 views

author.php not showing content if Author has no Posts

I am making a custom Genesis theme, and have a custom author.php file that pulls in various custom fields (Using Advanced Custom Fields), and author meta information to the page from the author ...
0
votes
0answers
19 views

Checking and Incrementing a custom user number

I've got this function that checks when a user is created that if the option Candidate is selected it adds CAND infront of the USER ID: function fidsa_member_number($user_no = false){ global $...
0
votes
2answers
18 views

Getting different user data depending on where I use variable

I'm looping through all users with $allusers = get_users($args); foreach ( $allusers as $user ): And then I have an email user button (firstname and lastname are ...
0
votes
1answer
34 views

Display custom image field in user profile

I am trying to display user info from acf so far the normal text, radio and select and date fields display if I use the following: <?php $current_user = wp_get_current_user(); echo $current_user-&...
0
votes
1answer
22 views

Update a user meta key based on WooCommerce product purchase

I have a WooCommerce shop. I have a custom user meta key for user expiration that I need to update based on the result of all users who have purchased a specific product. Unfortunately, I have not ...
1
vote
1answer
11 views

Adding number to date not working [closed]

I am adding number stored in custom user meta data to current date. Here is my code $addeddays = get_user_meta($this->order->user_id, 'xxx', true); $timeBase = date('j.n.Y'); echo date('j.n.Y', ...
0
votes
0answers
12 views

Is it possible to remove a conditional value from WordPress custom metabox

Here I have attached the screenshot from MySQL for easy understanding. In this meta value a: denotes total no of users liked the post. User denotes user with id user-id My question : Is it possible ...
0
votes
0answers
17 views

Post Meta deletion ajax not working

I am trying to remove function in the backend of post like plugin. In the post like plugin they are storing values in the following manner that is User Id , Post id and comment (or) Post . ...
0
votes
0answers
5 views

WooCommerce: how to store the e-mail being used for purchase in PayPal as billing email?

When sending users to complete payment inside PayPal (default PayPal Standard is in use in my shop), how can I grab the PayPal e-mail account used by the user to pay, instead of the e-mail user used ...
1
vote
0answers
26 views

Adding custom class to get_avatar() image doesn't work

Instead of outputting <img alt="" src="#" srcset="#" class="avatar avatar-60 photo" height="60" width="60"> I want to add custom class which looks like <img alt="" src="#" srcset="#" class=...
0
votes
1answer
31 views

get_the_author_meta i want to write in a loop

I'm working on WordPress I'm trying to write foreach to the get_the_author_meta here href and <i class="fa fa-facebook"></i> coming dynamically how should i write in a loop this is my code ...
0
votes
0answers
23 views

How to save profile pic and display in edit account page without any plugin in woocommerce

I want to add upload profile field and save it in edit account page without any plugin in woocommerce. I added the below code in functions.php to add profile photo in account page add_action( '...
0
votes
1answer
25 views

How to set a user meta key value based on another user meta key value

Each of the 7,000+ users on my site has around 25 keys in the usermeta table. I won't list them all, but two of the keys are "access_code" and "association". There are several dozen unique access ...
0
votes
0answers
20 views

'per_page' option isn't saving to the database on custom admin list page

Hoping this makes sense and one of you folks can see what I'm missing. I've got a custom table for a plugin that I'm designing for WordPress. I want to display the information from the table on the ...
0
votes
1answer
33 views

using custom meta user data to run queries in WordPress

I have added custom user meta data to the WordPress user profile below is the code I used to add this data. This part of the code seems to be working fine and I do not have a problem with it. <?...
0
votes
0answers
26 views

Setting up activation keys for page access / content gating

I'm currently looking for a way of content gating for my current WP project. I am offering a psychological test, and since I have to pay licensing fees for every participant, I want to be able to sell ...
0
votes
0answers
17 views

How to add specified user role's all users list on drop down menu of Buddy Press custom add profile field

Is anyone an idea to add separate user role's all users list in drop down menu of custom add profile field of Buddy Press ? For example I have three types of roles. Admin,Doctor,Patient. I ...
0
votes
1answer
17 views

How to get value from radio buttons meta box, and return different contents?

I have a multiple checkbox type question (using Ultimate member) storing values as user meta. The question basically asks the user what he wants, and according to what he wants, I would like my ...
0
votes
1answer
42 views

Increment user meta data by 1 each time a page is visited

Can't for the life of me figure out why this isn't working, I've tried like below with $val, I've tried sticking the get_user_meta into the meta_value, I've tried just adding +1 in the meta_value but ...
0
votes
1answer
14 views

Read array in php?

I'm trying to add some custom user meta on the registeration. For example, I have field to set a fruit : function some_fruits($fruit= false) { $fruits= array(); $fruits['1'] = 'Apple'; $...
0
votes
1answer
17 views

If logged in user views his profile page

I did some search but could not find the exact answer. My goal is the display "edit link" on profile pages but it will only visible to that user. For example, John logged in and views the page site....
0
votes
0answers
16 views

Add another role to a user when they click a button?

On my site, there are roles "user, authors, etc.". Default role for user is "User" which I want to keep it for all users. How to add another role to a user when they click a button? I tried with my ...
0
votes
3answers
242 views

Displaying user data within ACF relational field (user type)

I'm trying to display user info including custom fields determined by an ACF relational user field, and all contained within a flexible content field. EDIT Updated code following answers / comments, ...
0
votes
1answer
31 views

Cannot Update user meta in custom field

I have field to change user meta but update user meta does not change add_action('user_register', 'save_extra_fields_country_institution_user_form'); add_action('profile_update', '...
0
votes
2answers
83 views

Store custom field's multiple values in one user meta key

I've added some custom fields into the user profile. It's "Date of Birth". There are "month_of_birth", "day_of_birth", "year_of_birth". How to store them in one meta key ('birth_date') ? Here's the ...
0
votes
1answer
26 views

Get field in readable word

I added a custom user meta field named "Country". Code for adding the custom field: // ADD EXTRA PROFILE FIELD add_action( 'show_user_profile', 'extrainfo_show_extra_profile_fields' ); add_action( '...
0
votes
1answer
26 views

shortcode display metainformation as linked image

I am trying to make this shortcode to display a self made meta field called qrbase_code_pass_url as a linked image. The image should be static, but should get the dynamic URL from the meta field of ...
0
votes
0answers
24 views

Output auto-generated meta values

I'm able to get this working in a shortcode. However, I need to know how to output the auto-generated meta values (it's an auto-generated token) which is ["bepdf6q"] This is the array from the ...
-1
votes
1answer
59 views

Custom user meta values in shortcode

I've been searching around but can't find the solution. I'm trying to show some user meta values for current logged in user in a shortcode. The meta key is _wc_braintree_credit_card_payment_tokens ...
-1
votes
1answer
33 views

Custom user meta data [closed]

I want to build a WordPress website that redirects the users to a verification page, after successful login on the login page. This verification page should ask for a 6 digit PIN which should be ...
1
vote
1answer
67 views

Why is functions.php file in child not initializing and over-writing parent?

Good evening, I had some modifications in functions.php file to complete on my current wordpress website development. I have completed new code within the file and uploaded my edited function file ...
0
votes
1answer
31 views

Adding Author Box Meta Links with Co-Authors

I have a site that has multiple authors for a single post, requiring multiple author box bios after the article. I previously used get_the_author_meta() to pull the user's social media hyperlinks ...
2
votes
1answer
25 views

User Relationship

I have created a custom registration page, whereby a person will receive a code from another user and type in a code upon registering. If the code matches, i need the user who has just registered to ...
1
vote
1answer
105 views

Make this Fast and Queryable

I have 100,000+ registered users on my WooCommerce site. I have a subscription billing that people earn 5 entries each billing with. All users have the ability to earn entries for every $5.00 spent. ...
0
votes
0answers
17 views

How can I track who clicked what in my member area?

I have a protected member area where registered members (= logged in with a Wordpress user account) can click to view videos and click to download PDF files. I want to know which user clicked what ...
0
votes
0answers
34 views

How to add usermeta data in custom plugin in wordpress

although i am new in wordpress.i am trying to insert data from my custom plugin but nothing happen. previously i tried it from showing user profile it succeed but now i am not able to save data. my ...
1
vote
1answer
126 views

Check for user meta data at Login

On my website, users have a meta data attribute that is set to either true or false depending on whether they have confirmed their email address or not. I'm trying to not let them log in if they have ...
0
votes
2answers
78 views

add_user_meta allows multiple clicks and inserts more than 1 value

I've just checked a double click on my form that inserts new user meta, which actually inserted it twice! The problem is, I actually need the values to be non-unique so I can insert multiple times. ...
0
votes
1answer
127 views

How to save custom plugin form data to user meta table

I made a custom plugin.Now i want to store the plugin data in user meta because every data will store for individual user and will be display in frontend for individual user.Only admin will be able to ...
0
votes
0answers
31 views

how can i login with user-meta (phone-number)

i want to write one plugin with this Properies : 1- register with phone number 2- login just with phone number and password in login form. now my code is : add_action( 'register_form', '...
0
votes
0answers
14 views

Limit users (by user role) to create a certain amount of pages

I asked this question before, but unfortunately I had no luck to get it working. Perhaps someone here can help me? The intention is that I can create users with a certain user role, these users then ...