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
10 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
27 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
14 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
0answers
27 views

WP_User_Query using meta_query with multiple fields not working, returns everything?

I have searched and tried various suggestions, to no avail. If I don't use meta_query and just use a single set of args it shows the proper matches, but when multiple fields are introduced the whole ...
0
votes
1answer
22 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
8 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
23 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
24 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
10 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
27 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
23 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
26 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
11 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
19 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
35 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
27 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
23 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
19 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
15 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
19 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
22 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
4 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
10 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
9 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
51 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 ...
0
votes
0answers
10 views

Wordpress popup asking usermeta info from the user

I am writing a code for a unique task, trying to describes thru below steps: User Log-in to his/her account User wants to comment on a post A popup will come and ask his mobile number (This mobile ...
0
votes
0answers
17 views

Relating wp_user, wp_usermeta, and a custom database table

I am working on a site for a non-profit that has collected data on their 'Members' (over 2,000 members). Members report their surgeries and experiences in order for the non-profit to collect data on ...
0
votes
0answers
18 views

generate PDF from member information

I'm building a website with membership and I would like to generate a pdf using user information such as name and email and to make it downloadable in his member space. I've seen that there are some ...
0
votes
1answer
37 views

check for duplicate user meta data before updating

I have added the ability for a social security number to be added for users. This field can be edited on the individual users screen but the data is saved to the usermeta table. When editing a new ...
0
votes
1answer
24 views

users joined group count in buddypress

How to get users already joined group count by user-id or username in BuddyPress. For example, In the member listing page, in the members loop, I like to get users group count and display in the ...
0
votes
0answers
25 views

Add custom fields to different roles?

We need to create custom fields for different roles (at least two), but we must enter these different roles the dashboard. example: creating a menu item with editor menu with the url: wp-admin/user-...
0
votes
1answer
40 views

how to set default update_user_meta values wordpress

so i installed a theme which gives a default value to a meta the code the theme uses is update_user_meta($uid, '_sb_pkg_type', 'free'); i would like to add this code to wordpress core ...
0
votes
1answer
23 views

Adding user metadata to all users

I am not sure what I am doing wrong here. I am trying to automatically add this metadata to each new user upon registration. function add_to_group($user_id, $meta_key, $meta_value ) { $...
0
votes
0answers
41 views

How to select meta key in custom database query

I am using wp_list_table to create a custom table and I want to get some meta data. I can get it to work if I am just querying the users table for example like so: $sql = "SELECT * FROM {$wpdb->...
0
votes
1answer
46 views

How to position user meta data field

I have 1 additional field I want to display on the user profile page (mainly admin users will use this) I have done it but it is showing up at the very bottom of the page, I want it to sit in the ...
0
votes
0answers
65 views

How can i add user display name drop down menu in frontend?

How can i add user display name drop down menu in frontend? then user can choose preferred display name? In fact, I used this code answered here: How to edit a user profile on the front end? submit ...
0
votes
0answers
44 views

How to save/post javascript variable to usermeta

I built a simple math game for my son using javascript so he can practice his math facts. I want to be able to save and track his high scores using the usermeta table, but I am having trouble ...
0
votes
0answers
13 views

Custom column in user table displaying total comment count

I need a custom column in the user table displaying the total comment count of approved comments of each user. I know how to do this using a plugin, but I would rather use a snippet in the functions....
0
votes
0answers
35 views

How to get a list of users who like a current wordpress post & remove post dislike & comment like/dislike system

I have the code, the code working fine. But i want modified somethings. //function file add_action( 'wp_enqueue_scripts', 'sl_enqueue_scripts' ); function sl_enqueue_scripts() { wp_enqueue_script(...
0
votes
1answer
45 views

How to order custom fields in the user profile (admin area)

I’ve added a custom section to the user profile in my own theme. The section is called „Extra Profilinformationen“ for now and includes a field for twitter. It’s added to the bottom. Is there any way ...
0
votes
1answer
21 views

User updating their profile wipes my custom fields

I have created a plugin to add extra fields to user profiles. These fields can only be edited buy admin and do not show on the user'profile page. The extra fields are shown and can be edited by admin. ...
0
votes
1answer
137 views

get_users / WP_User_Query returns empty when logged out

I have a fairly basic user query pulling staff members on a website I'm working on. When you are logged in to WordPress they are showing on the front-end. But when logged out they are not displaying. ...
1
vote
1answer
22 views

Save User Meta Email Address in Lowercase

I'm looking for a way to save all email addresses to user meta as lowercase, ideally without validating and asking the user to change it but instead just saving it as lowercase. I've got as far as the ...
1
vote
1answer
18 views

Get list of taxonomies associated with Subscribers

I used this tutorial so that I would have the ability to associate categories with users. However, I changed the code so that it would show only on Subscribers profiles (not Authors like in the ...
1
vote
1answer
38 views

User last login and user last visit problem

Need some help with debugging. I have two function is functions.php One to capture user last login function user_last_login( $user_login, $user ) { update_user_meta( $user->ID, 'last_login', ...
1
vote
0answers
21 views

Meta_query on same meta key, with diffrenct values

i'm trying to get_users with the meta_query where i need to find users where either they don't have the meta key, or it is blank. It seems like everywhere i look, i should be able to use the OR on ...
1
vote
0answers
38 views

Dynamic URL based on user_metadata

I want to know how can I dynamically change the page a user is taken to when they select a URL....using wordpress user metadata fields? My users have either selected "male" or "female" as their ...

1
2 3 4 5
16