Stack Exchange Network

Stack Exchange network consists of 175 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 [users]

Refers to accounts with the ability to login and participate in a WordPress site.

2
votes
1answer
57 views

What's the difference between the capability remove_users and delete_users?

In the list of capabilities, I found there's both remove_users and delete_users. It's not clear to me what remove_users is supposed to do, the Codex documentation just says it was introduced in ...
0
votes
1answer
14 views

Set “editor” role to existing user

Using the User ID of an existing user, how do I change the role to Editor? Here's what I tried: $wpdb->query("UPDATE wp_usermeta SET meta_value = 'a:1:{s:6:\"editor\";b:1;}' WHERE user_id = '$...
0
votes
1answer
38 views

How to create a specific role to manage users

I have created a non-admin user role to manage users. I have given this role the following capabilities: Create User, Delete User, Edit User, List Users, list roles. A member with this role CAN create ...
0
votes
1answer
28 views

Call to undefined function get_userdata() in plugin

After refactoring/restructuring files in my plug-in, I now get the error Uncaught Error: Call to undefined function get_userdata() after code $current_user_id = get_current_user_id(); $...
1
vote
1answer
20 views

Is there a smart way to obtain a list of only some selected user meta data?

I have a case where, if I had written the DB and queries myself, I would just do something like SELECT name, firstname, email FROM users WHERE .... Returning me a list/collection/array, I mean, not ...
1
vote
1answer
17 views

Is there a way to identify a user in a custom REST API method?

In a custom REST API method, I would like to identify the user (typically get_current_user_id() then retrieve their data from database (things like they're role and some custom permission). But so ...
1
vote
0answers
38 views

Add New User, extra fields which are required?

I use these two functions to be able to set the first and last name when I go to Add New User: // Add First and Last name to Add New User function add_new_user_name_fields($user) { ?> <...
0
votes
1answer
28 views

Creating user in Firebase after Wordpress user registration

I have developed an App that uses Firebase. The user has to go through a Wordpress website and buy a subscription before being able to access the App. When a new Wordpress user registers, I would ...
0
votes
0answers
15 views

How to track and restrict external download script by logged in wp users?

My goal is to restrict direct download of external url (which has script) only to wordpress logged in users. I think we should track it by wordpress logged in user cookies. But i need a way to ...
0
votes
1answer
18 views

Filter to wp_list_authors

I am using wp_list_authors, to, how function name says, make a list of authors, but i want to show only "Authors". Now in my site, any account who publish a text ("Admin", "Editor") show his name in ...
-1
votes
1answer
21 views

User register hook can't access form request

I'm trying to add a few custom field to the registration form using the code below. After registrations customs fields with keys are created but they don't have any value. I think that my $_POST['...
0
votes
0answers
23 views

Permalink structure like facebook.com

I want permalink structure like facebook.com facebook.com/username/about facebook.com/username/posts facebook.com/username/photos facebook.com/username/videos facebook.com/username/reviews I need ...
0
votes
0answers
39 views

fine-grained capabilities for user related capabilities

When we want to adjust users capabilities, we can do so quite fine-grained. For example we can configure that a certain user can edit posts. But furthermore we can limit the capability of editing ...
0
votes
0answers
11 views

How can i export images and videos on wp personal data export page?

Is there a way to export user's profile photo in the WordPress user data export page. I have created users and i gave each one of them a profile photo. The problem is, when i export their data to the ...
1
vote
0answers
18 views

How to delete all customer user account that haven't placed a single order?

Recently I've had an influx of spam users registering on my Wordpress website and I am trying to delete them all if: they have a "Customer" role haven't placed at least one order before As I could ...
0
votes
1answer
23 views

Delete Users without a First and Last Name

I need to clean a WordPress Web site of SPAM users. I checked the Users list and noticed that valid users have a proper Name listed; SPAM users do not have that value and a - is displayed instead. ...
2
votes
0answers
33 views

How can I find users that didn't set a password?

Is it possible to find (and bulk delete) users that registered on my WordPress site but never set a password over their confirmation email?
0
votes
1answer
51 views

How to save multiple custom user profile fields using repeater JQuery

I'm trying to create a multiple custom user profile fields to allow our users adding more software skills in their profile page. The problem I'm facing is it always saving only one meta for "skills" ...
1
vote
0answers
16 views

How can i customize the export personal data file?

I want to know is there a way to customize the export personal data page? If you go to wp dashboard > tools > export personal data, you can download an html file which contains your personal data. Is ...
0
votes
0answers
15 views

Creating front end admin area for users

I am creating a front end custom admin area for registered users. The logic and everything else in in place, so it works. BUT, I have created this using pages with custom page templates. I feel this ...
0
votes
1answer
94 views

Can't add users in admin after copying database

This is a really strange issue. I'm testing a large production Woocommerce site with a 2 gig database. The production site needs updates to Woocommerce and plugins, so I want to test on staging. I can ...
0
votes
1answer
19 views

Is it possible to access plugin data from a custom feed template?

I'm trying to use current_user_can in a custom feed template (created using add_feed) to check if they have a particular Memberpress membership plan in order to access the feed, but while I can get ...
0
votes
2answers
20 views

How to add new custom field in default add user form through plugin

I am new in wordpress , started plugin development in wordpress a week ago . I have to add the new custom field in default add user form , is it possible . Then i if write wp_get_current_user() , is ...
0
votes
0answers
11 views

Lock CMS during code updates

Is there a way to temporarily log out and disable all users from WP admin to stop content creators from making any database changes during a major page rebuild?
1
vote
2answers
15 views

WordPress User Taxonomy Saved Values

I have been following a tutorial on setting up a user taxonomy on Justin Tadlock's site. I got everything working but I wanted to adjust the taxonomy from a single radio selection to a multi checkbox ...
0
votes
0answers
57 views

wp_get_current_user Not working

I am using the wp_get_current_user() function inside a hook which fires before email is sent from contactform7 . The function works but the main problem is that the function doesnt return the current ...
0
votes
0answers
13 views

How to show users with have role in separate menus in wordpress admin panel

In users menu Wordpress admin panel, for default shows all users with all roles in a menu. I want to show users with have role in separate menus in wordpress admin panel. For example each users have ...
0
votes
0answers
18 views

Sync users from production and development environments using wp cli

I want to sync users registered at production environment to development environment. Using the below command sequence for this: 1) Find max user id at the target dev environment using: wp ...
0
votes
0answers
24 views

wordpressPCL user meta

I'm using the wordpressPCL library to create new users. I need to insert Meta fields as well, how should I structure this field? private static async Task InserUser() { ...
0
votes
1answer
10 views

Change author base and slug in author link

Hello im trying to change the author link from mysite/author/username to mysite/companies/dataFromUserMetabox i tried the approach from this answer chage author url its working the url changed but ...
0
votes
1answer
10 views

On button click, redirect users to registration page instead of another page

I have a button that I have that leads users to a page on WordPress called /portfolio/, so is there a way that I can redirect users to the /registration/ page until their logged in? I'm using a ...
0
votes
0answers
23 views

meta_query orderby sort multiple keys

I'm trying to read the birthdays of the users in my database through custom fields that have been added. Displaying the current months is easy but I am trying to capture the current month(remainder) ...
0
votes
0answers
15 views

User can hide post just for him

I have a RSS wordpress site so there are many new posts all the time in different categories. I would like a function so that users themselves can hide posts which they don't want to see again. So ...
0
votes
1answer
52 views

Hide menu item when users are logged in/out

I want to be able to hide the 'My account' button when users are logged out and I want to be able to hide the 'Registration' button when users are logged in. How would I go about doing this? I'm ...
0
votes
1answer
12 views

Users activity history

we had some problems in our wordpress web when we changed some issues on the code, and I would like to identify which of the changes made the web crash. I've tried some plugins as Simple History, but ...
0
votes
0answers
27 views

get_user_by() sometimes returns false, but the user exists

I am using child theme and I am replacing the base action for registering a user in my child theme: add_action( 'wp_ajax_nopriv_parent_theme_ajax_register_form', '...
0
votes
1answer
14 views

Editable registration date field in user profile

I'm using this code to display in the user profile backend a field that will show the registration date of the user. When I change the date and hit save, the registration date wont change, it will ...
0
votes
1answer
15 views

Disable emails for new user registration

I want to disable the default email that is send when user is registered. I am using this plugin for email verification User Verification By PickPlugins, which sends an email with confirmation link, ...
0
votes
0answers
19 views

How to prevent users from deleting their accounts?

I'd like to prevent user from deleting his/her account. This is mainly because of our internal rules requiring either two users being deleted at once or none at all. The only way to delete accounts ...
0
votes
1answer
27 views

Echo Text If User Is Logged in But NOT the Author of post

i am coding a plugin, where user can subscribe to a indvidual author of post (like we do on YouTube). I want to display the subscribe link to all logged in users, but not the author of post. my ...
0
votes
1answer
28 views

Searchable Semi Random Number Generator on User Profiles

I'd like it so that when a user creates a profile, there is a custom form that states "ID Number", which is then semirandomly generated. So, for example, if Joe creates an account, he'll be asked a ...
0
votes
0answers
19 views

how restrict user to give star ratings once for a post?

I am creating a plugin where i want to restrict a user to do give ratings to the post but not more than once. function frs_insert_ratings($content) { if(!is_feed() && !is_home()) { global $...
0
votes
0answers
12 views

Create user with sql if it does not exist in wordpress

Forgive me if I'm in the wrong place, I'm digging the Stack Exchange world. This functional sql code creates a user in wordpress: INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `...
0
votes
0answers
10 views

Send registration mail to new user from custom build form

I am using a custom build form connected through an API which has an email field as last field. After that the user presses on a button and the preferences are communicated with the other service. ...
0
votes
1answer
48 views

How to pass external variables to the wp_new_user_notification_email filter?

We're trying to customize the default e-mail new users receive when registering on our website. For this, we are using the wp_new_user_notification_email filter added in WP4.9.0 For our functions.php ...
1
vote
0answers
26 views

Good way to block users within a multisite setup without deleting them?

This is probably a common problem with multiple possibilities to solve. However I am asking for an easy solution as I guess I am not the first one to have this problem. Assume we have a huge company ...
0
votes
0answers
7 views

Is there a way to allow users to customize their feed, i.e. choose what categories they see first when they log in?

I run an aggregator site and want to give people more ways to see what they want. I have it broken down pretty comprehensively by categories and think a tailored feed would make a lot of people happy.
1
vote
0answers
28 views

WP_User_Query by meta_value with Number returns nothing

When querying users with WP_User_Query by meta_value like '23432' (as string or integer) it returns nothing. If searched by text like 'admin' it returns all users where meta_value equals 'admin'. ...
0
votes
0answers
28 views

How to update user meta from php file?

I need to update user meta from php file on my server. Maybe I need some additional permissions? <?php require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php'); $user_id = 1; $new_value = 'http://...
1
vote
1answer
47 views

Filter dropdown in users.php “delete user” bulk edit screen

I recently attempted to delete an administrator user. Using the bulk editor, I selected "delete" and was presented with the option to assign their content to another user. However, the dropdown ...