All Questions
254 questions
1
vote
0
answers
21
views
Removing user removes user meta?
Sorry for the basic question, but I couldn't find an answer by reading the docs. When we delete user in the WP admin area, will WP delete the associated user_meta too?
0
votes
1
answer
29
views
Default Usermeta Entries for every newly created user?
we have a Buddyboss page running with 30k users. Our usermeta Table is growing fast because of a few plugins we use which all seem to write a lot of settings to it. I try to remove as many obsolete or ...
0
votes
2
answers
415
views
Add Additional Column in "Users" Dashboard Area - BP Extended Profiles (WordPress)
I have a site with extended profile fields. I can't find the particular way of adding an additional column as:
Username | Name | Email | Site Role | Discord (this is the additional column)
The ...
0
votes
1
answer
58
views
How to use 2 different databases but share the same user in wordpress
I have 2 wordpress websites on the same server, one is bloo.com and the other is forum.bloo.com. each site has its own database, they have their own wp_content, each has its own file separately, but I ...
0
votes
1
answer
40
views
Group users by meta field, with name of meta field as group title
I'm creating a employee photo directory based off users from my site. I'm trying to add front end filtering for this query and I have it mostly working.
What I'm trying to accomplish is to sort the ...
0
votes
2
answers
13
views
Transform user name before displaying
Users are created whith name in upper case on my site, but some admin want to display it in lower case.
I had a custom field in user profile to identified those admin, but I don't know what hook I can ...
12
votes
7
answers
27k
views
How to filter users on admin users page by custom meta field?
The Problem
WP appears to remove the value of my query variable before it gets used to filter the list of users.
My Code
This function adds a custom column to my Users table on /wp-admin/users.php:
...
16
votes
10
answers
37k
views
Adding fields to the "Add New User" screen in the dashboard
I'd like to add the field "Company Name" to the add new user page in the admin panel. I've done quite a bit of searching and have been unable to find details on how to do this. I can easily add info ...
20
votes
3
answers
32k
views
user_login vs. user_nicename
When you call the get_users() functions, a list of user objects are returned. Each of those users has a number of properties. What is the difference between user_login and user_nicename in those ...
2
votes
1
answer
6k
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
1
answer
20
views
Buddypress: "Auto load" specific usermeta in WP?
I have a Buddypress membership page, and for specific customizations I need a few usermeta fields being loaded all the time, for the currently logged user as well as (in case any) the displayed user-...
10
votes
3
answers
20k
views
Check if user is admin by user ID
Any ideas how to check if user (by user ID) is administrator? I don't mean currently logged in user.
2
votes
0
answers
822
views
Rest API code to get ID of current user not working: get_current_user_id() gives 0
Background
I am trying to write Rest API code to get the ID of the user who triggers the function in question. I found a fantastic answer to this exact question, that was very kindly provided by user ...
-1
votes
1
answer
3k
views
How to change the value of a variable using input field?
I have created a wordpress website. I want to extract each user's data using php through his/her id.
I have created this code;
<?php
$userid = /* help me get the below input field's value */
$...
0
votes
1
answer
748
views
Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users search" input box
I have been looking to extend the ability to search users in the backend for some time and have tried variations of several functions recommended in these articles and posts along with others not ...
0
votes
1
answer
248
views
MySQL query to list users who never signed in
What MySQL query can I use to get a list of users who have never logged in to WP?
Some background...
My WordPress website has been running since 2015 and initially, I had a newsletter form that would ...
11
votes
3
answers
42k
views
get_user_meta() doesn't include user email?
I simply wonder why <?php var_dump(get_user_meta(4)); ?> doesn't contain an email address of the user. Instead I have to use
get_userdata(4)->user_email; to query the email of the user.
...
1
vote
2
answers
2k
views
WP User Query fails when searching meta queries and search columns
I'm building an advanced User search using WP_User_Query but experiencing some unusual behaviour. I'm trying to search with a term that I know exists in the user_nicename and user_email fields but ...
0
votes
1
answer
4k
views
Display current user metadata on Wordpress page
So I have a Wordpress website, and I want to be able to display the current logged in user's data on a page. Previously, I had been able to find a snippet of code that would go go in functions.php and ...
0
votes
1
answer
2k
views
How to Access wp_usermeta Data Immediately After a New User is Created
I am trying to find a WordPress action hook that will allow me to access a new user's wp_usermeta information, immediately after the user has been created. In our registration process, custom fields ...
0
votes
2
answers
1k
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
1
answer
51
views
delete_user_meta from a foreach results page
I have a real estate site. On property pages users can save homes as a favorite. The property gets added to the user meta data. I can successfully add and delete entries from the single property ...
0
votes
1
answer
2k
views
Updating custom user meta
I have created a new custom meta for my wordpress users. These are just 2 radio buttons (either 'Yes' or 'No').
I have created a button on the front end and want it so that if the button is clicked, ...
0
votes
0
answers
138
views
Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the "users search" input box
Update: A solution for this question was provided byt @t31os_ here Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the "users ...
0
votes
1
answer
1k
views
ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
I am looking for a way to query users based on a user meta entry for an advanced custom field which has a given value and itself is from a given layout type.
For example, let's say I have the ...
2
votes
1
answer
1k
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:
...
1
vote
0
answers
244
views
Create Unique and Customized User ID for Website Members in WordPress
I want a Feature which can allow Custom User ID creation at Registration on WordPress.
This will be different from the User ID that WordPress creates at Registration.
This one is something that is ...
0
votes
2
answers
12k
views
How can I sort get_users() by any value (last_name, user defined fields and more)
I want to sort the result of get_users() by last name, first name, user defined fields or whatever.
How can I achieve this while still using get_users()?
1
vote
1
answer
1k
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
2
answers
1k
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
2
answers
2k
views
User list order by user meta
i have created user vote that can vote users or author of posts. so for example have 4 users which looks:
user --- ID=1 --- META KEY='_thumbs_rating_up' --- META VALUE='13'
user --- ID=2 --- META KEY=...
0
votes
1
answer
23
views
How to pull all the contributer users records and order by Designation (which is users meta data)?
I want to show all the contributors by the Designation. Following code is only pull the records and order by ID But I need to data order by Designation:
function contributors() {
global $wpdb;
$...
1
vote
1
answer
6k
views
Add custom user meta data
I want to add a custom meta data for all the users with a default false value. I have researched about adding a meta data i.e, add_user_meta( int $user_id, string $meta_key, mixed $meta_value, bool $...
0
votes
2
answers
272
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 ...
3
votes
0
answers
2k
views
Searchable meta value in user.php
I have created a new column in the user table list (admin page) and would like the column to be searchable in the search query, How do i add the meta to the search users query ?
/**
* Create user ...
1
vote
1
answer
891
views
Modify Database in Multi-Site wp_usermeta table
My name is Antonio and i'm from Ecuador, my english is not good but here we go.
I already have my Multi-site installation working, but the "wp_2_" site have some error in the functionality, because i ...
0
votes
2
answers
2k
views
Front-End User Profile
I have a front end user profile template I am working on, and everything is working fine except for upload a profile picture. I have a custom user field created and I am trying to use the button file ...
0
votes
1
answer
1k
views
Update a user profile via frontend
I'm very new to WordPress so I have a simple beginner question.
I've added some custom user fields on the admin form with the action show_user_profile, edit_user_profile, personal_options_update, and ...
0
votes
1
answer
55
views
Delete user meta but only if found in array
I created a SAVE button that saves a page's URL to the user meta in an array. I'm trying to now create a REMOVE button but I'm finding that when delete_user_meta is used it deletes all entries in the ...
0
votes
1
answer
536
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
2
answers
19k
views
ACF Upload Image in front-end with custom form
I created extra fields for my subscribers, one of them is an image field, so they can upload an image to their profile.
I created the fields with ACF (Advanced Custom Fields).
I have a custom ...
1
vote
2
answers
3k
views
Does wp_delete_user() remove all user content?
I'm deleting WP users with wp_delete_user(). It works well. I noticed when I manually delete a user in the WP Admin it asks first to "Delete all content" or "Attribute all content to: ".
I want ...
1
vote
1
answer
1k
views
How to add custom detail page for a Subscriber at Admin Panel
I have created a custom page which shows the list of Users(Role = 'Subscriber'). I named this page "Reporting" & It is based on wp_list_table. Now I want to show the user details (having custom ...
14
votes
2
answers
3k
views
Difference between update_user_meta and update_user_option
Can anyone explain what is the difference between update_user_meta and update_user_option and in which scenarios the both can be used?
3
votes
1
answer
3k
views
Extend the wp_users table
I'd like to to extend the wp_users table in my WordPress' database.
Why? I want people to add more information about themselves when they sing up at my website.
I know how to extend it, but I'm ...
1
vote
1
answer
3k
views
Display sortable User meta column in admin panel user's page
I have defined login levels for users registered on my site as Level 1 and Level 2. I have added a column for same in admin panel users page (users.php), I'm trying to add sorting option but on click ...
0
votes
1
answer
508
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
0
answers
689
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
0
answers
407
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 ...
1
vote
1
answer
261
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 ...