Questions tagged [user-meta]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
13 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
34 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
14 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
11 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
15 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
18 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
12 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
22 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
15 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
47 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
34 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
9 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
16 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
20 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
36 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
17 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
11 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
14 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
31 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
16 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
27 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
10 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
30 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
11 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
33 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
25 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
22 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
39 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
53 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: ...
0
votes
1answer
24 views

How to order users by a date in the meta_value array

I have an 'payments' meta_key for the users. I store the payment information (date and payment amount) received from the user in meta_value connected to this meta_key. For example: array( [0] => ...
0
votes
0answers
28 views

How to display a custom users table?

I want to create a separate users page where I can display users based on a large number of User meta. I know that there are hooks to add columns to the user table, but that's not what I want (since ...
0
votes
1answer
17 views

How can I return an error message when updating user meta?

I have a custom user meta field where I want to accept only integers between 0 and 50. I'm using an input field of type="number", and I'm checking from within my update function if the input is any ...
0
votes
1answer
39 views

Gender based user avatar

I'm creating a matrimonial website. I want to set the user avatar based on the gender(I have a custom_user_meta for the user's gender) But I don't understand how to get the "user id" in order to use ...
0
votes
0answers
24 views

How to add new array to existing meta value array?

Header code $user_id = get_current_user_id(); $existing_setup = ( get_user_meta( $user_id, 'setup', true ) ) ? get_user_meta( $user_id, 'setup', true ) : ''; bottom code if ( ! function_exists( '...
0
votes
0answers
5 views

Check for duplicates meta on user registration/update

I have a user registration form that adds fields to users using usermeta. For example I add user_fiscal_code that must be unique for each user. Is there a way (hook?) to control its uniqueness ...
0
votes
1answer
21 views

Login redirect. Check user meta and redirect accordingly

I have a function that checks some user meta and then redirects based off that. I'm pretty sure this was working before I updated everything on my site. For some reason, now when someone logs in it ...
0
votes
0answers
23 views

How to remove the url format from the WEBSITE field in the user registry?

I would like to use this field with only simple text input without turning it into a url (http://empresa.com.br), I will change the label to Company and take advantage of the field to insert simple ...
1
vote
0answers
10 views

User Meta Data in a Sortable Table

I have created a template that stores extra user data in to user meta, for example: how fast they row 100m, how fast they run 5km. I'd like to now display this data within a table, thats searchable ...
0
votes
2answers
66 views

Like & Dislike functionality using JavaScript

I want to add Like & Dislike functionality into my custom post type, called game. I have placed like and dislike icon links in my post footer. Desired Behaviour: When a user clicks the like ...
1
vote
0answers
29 views

Creating user status mode in WordPress

A few days ago I came across a site. The site had a status where a user could post their status about that post. There were five modes: I've seen this anime I'm watching this anime See this in the ...
0
votes
0answers
14 views

How to structure numbers of posts accessed by a user in a membership site?

I have a Custom Post Type named Deals in my site. On each Deal page, I have a button which only users having membership access can view it. On clicking this button, a random coupon code in generated ...

1
2 3 4 5
16