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
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
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 ...
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
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
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-...
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 ...
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
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
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
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 ...
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 ...
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;
$...
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 ...
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
345
views
Associate multiple email addresses with the same user account, so they can log in with either
Is there a way to associate multiple email addresses (2) with the same user account?
The goal is for the user to be able to use their company email or personal email to log into a company portal - ...
0
votes
1
answer
430
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() {
// ...
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
351
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 ...
1
vote
2
answers
43
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
0
answers
19
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
0
answers
27
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
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 ...
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
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 ...
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
1
answer
247
views
Getting user data via ajax
I am trying to list registered users on the frontend which have a role of 'member'. I have a lot of advanced custom fields for the users though and don't know how to get those fields. I installed the '...
1
vote
0
answers
356
views
Updating wp_user_level on user update
I have the following code, which properly adds the wp_user_level of 2 when a new user is registered with the role "division_manager". I need the wp_user_level to be non-zero so they can be ...
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
1
answer
696
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
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
1
answer
52
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 = $...
0
votes
0
answers
104
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
0
answers
39
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 ...
1
vote
0
answers
121
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 ...
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
36
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
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
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
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 ...
0
votes
1
answer
45
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
0
answers
148
views
Store data from JavaScript object to custom table in user account
When a user is logged into WordPress, I want to be able to store data coming from a JS query into a custom table of the user in WordPress.
I want to show this data when the user goes to their user ...
0
votes
0
answers
295
views
Hook into form handle from admin users table
I'm adding a couple of buttons to the user table in a custom column, in which, on click will need to either approve or reject the user via update_user_meta.
I've tried hooking in with profile_update,...
0
votes
1
answer
439
views
Hook into add_user_role and update based on new and removed roles
I need to add user meta based on each role added and removed. I tried to achieve this by hooking into add_user_role and looping through and updated list of user roles but the old ones are still ...
1
vote
0
answers
34
views
get_user_meta an ID for multiple functions
i created an frontend profile for users, where they can add some informations to there profile. All the infos are stored in the usermeta. To show these informations on the frontend profile of the user ...
0
votes
1
answer
76
views
How to prevent multiple user accounts with the same meta field?
I run an ecommerce site on top of wordpress.
There is a particular meta field that users fill out when they checkout with me. Let's say it is the address of the user.
I would like to setup my site ...
0
votes
0
answers
330
views
Export Wordpress User Meta to CSV/Excel
I have shops and consultants both set up on Wordpress as users with different roles. I want to include an "Export" link on the consultants' profiles using a shortcode that will export the shops on ...
0
votes
1
answer
70
views
Custom Field Repeating When Using foreach
I'm trying to display user avatars by login user name using custom fields like this -
And here's the code -
function user_avatar() {
$name = get_post_meta( get_the_ID(), 'user_name', true )...
0
votes
0
answers
83
views
How to Moderate Edits to User Profiles?
I would like to moderate WordPress users’ edits to their own profiles. As I understand it, the default would be for the profile changes to go online immediately. Instead, I’d like to leave the older ...