All Questions
2,085 questions
0
votes
0
answers
38
views
Wordpress 6.7 - You are not allowed to list users during API call
I am trying to get a list of all users (not just authors). I have the below script in Codeigniter 4:
class WPUserModel extends Model
{
protected $wordpressApiUrl = 'https://blog.example.com/wp-...
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
2
answers
1k
views
WordPress user password reset not working
I have additional users set up on my WordPress site. One of the other users has asked me to reset their password as the 'forgot my password' function doesn't work (a reset password email isn't ...
2
votes
1
answer
135
views
Redirect Login Based on User Role
I'm currently using the following code to add a login form to a page. How can I redirect users after they have logged in based on a custom user role.
function my_login_form() {
$args = array(
...
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
35
views
Force Profile link for username, and stop "Website" field on Profile from becoming offsite link atop Comments, in "Recent Comments" list, etc
I've noticed that if "Website" is filled in on a user's Profile page, then the link formed around the username of that user will often (not always) point to that offsite link instead of to ...
0
votes
1
answer
53
views
Can a user submit requests to wp-admin/admin.php without logging in?
I have a site that has a malicious link being injected into it which causes every page of the site to be clickable and go to random sites. The script is being injected through the WPCode plugin which ...
167
votes
6
answers
427k
views
If the current user is an administrator or editor
How can I check to see if the current logged-in user is an administrator or an editor?
I know how to do each individually:
<?php if(current_user_can('editor')) { ?>
<!-- Stuff here for ...
1
vote
2
answers
827
views
Users as team members through a loop in elementor
I am trying to create a loop in Elementor's theme builder that will display each user with the role of the Contributor or Author. I.E. When the admin of the website will add a new user with the above ...
0
votes
1
answer
98
views
How to allow Contributors to edit their own posts, whilst still needing to be reviewed by an admin?
Im using the User Role Editor plugin to try to acheive this, but I've also tried PublishPress Capabilities and had the exact same problem.
I'd like it so that my contributor users work like so:
Their ...
0
votes
2
answers
414
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 ...
1
vote
0
answers
145
views
How to "attribute all content to" specific user once delete user in wordpress
I have a question about how to attribute all content to specific user once delete any user in Wordpress.
Is there any idea how could I disable "Delete all content" option and set as default ...
104
votes
8
answers
283k
views
How to check if a user is in a specific role?
I have a pretty specific requirement to show different text in a field label on the user profile page based on the current user's role. I can't seem to figure out how to check whether the current use ...
0
votes
1
answer
71
views
Is there a way to resend confirmation emails?
The title says it all.
There are several users who have registered but have yet to confirm their email addresses.
Based on their unique email domains, I suspect that the majority of unconfirmed ...
1
vote
1
answer
92
views
redirect to my login page if not logged in
When a customer wants to leave a review on the product page, they are prompted to log in if not.
Do you have a proposal to send the customer to the a specific login page and then return once logged in?...
0
votes
0
answers
58
views
TYPO3 to Wordpress Migration (Users)
I got a problem with migration from TYPO3 to Wordpress.
We got like 4.000 Users in Typo3 and want to migrate them to Wordpress.
Typo3 uses BCRYPT Password Hash, and Wordpress PHPASS.
I’ve changed the ...
0
votes
0
answers
12
views
How to remove/limit Editor accounts privileges, to prevent them from deleting media and pages created by Admin
How can I remove (or edit) Editor account privilege's, to prevent Editor accounts from making any changes to things Admin accounts upload or create?
For instance,
Prevent Editors from deleting/...
0
votes
1
answer
1k
views
Can't save changes or modify settings in Dashboard but Pages and Posts are fine
I am working on a client site from a previous developer. It needed many updates so I updated WordPress to v.6.0.1, Astra theme 3.9.1 (uses a child theme) and the many plugins in use. After all this, ...
0
votes
0
answers
46
views
Allow users to edit post without logging in
I'm working on a site where non-logged in users are able to submit their posts. It's easy to do on front end, however, when the posts need to be edited, it's a completely different story.
So, is there ...
0
votes
1
answer
106
views
wp_authenticate_username_password not authenticating properly when pass username and password
I am developing custom login page and want to login through username and password. To authenticate user, i am using this function wp_authenticate_username_password()
$usr_user = ...
46
votes
4
answers
137k
views
How do I add a field on the Users profile? For example, country, age etc
I'm not very good with computers/codes etc.
I use a plugin that makes a registration form thingy and in that form I added country, age group, gender and so on. I click the option that will add the ...
0
votes
1
answer
19
views
Will users still be able to log in if I change host?
The title says it all.
I am taking over a website from somebody who lives in another country and will host it in the UK.
Once the migration process is complete (moving it from their host to mine), ...
0
votes
0
answers
80
views
How can I display different menu for logged in users using a block theme
I am trying to display a different menu for the logged in users. The problem is that the classic wp_nav_menu_args filter does not work for block themes. Or I can't make it work.
Does anybody know how ...
0
votes
1
answer
74
views
Change a subsite Admin role of a WordPress Multisite after 24 hours registering
change WordPress multisite users' role after registration.
function woo_admin_to_editor($blog_id, $user_id) {
switch_to_blog($blog_id);
$user = new WP_User($user_id);
if ($user->exists()) {
$...
0
votes
1
answer
20
views
How is user visits calculated
the users screen includes the column 'visits'. It lists the number of visits but I would like to know how it is calculated?
0
votes
0
answers
15
views
Add a product for all users based on a condition (WooCommerce)
Hello everyone in my wordpress website, I want to add a product to all users based on a condition, I mean if a condition is true I will inform specific users and then add the product for them, how can ...
0
votes
2
answers
2k
views
Allow a user or role to view drafts and previews, but not other admin privileges?
How do I allow a specific user or a specific role to view drafts and previews, but not allow them to edit posts or have any other admin capabilities? I can add a custom capability to a role, but don't ...
0
votes
1
answer
1k
views
WordPress 5.8 - Hide or Remove personal fields from admin Profile page
There are several threads on this topic, but none updated to Wordpress 5.8
The question is, in 2021 WP 5.8, what is the cleanest or recommended code to hide profile fields when creating/editing a user,...
0
votes
1
answer
719
views
Link custom post type to users membership
I'm building a medical lab site, I'd like to link a custom post type - results to users.
How can I link results CPTs to a user?
The idea is to be able to associate multiple test results to a single ...
0
votes
2
answers
3k
views
change user password REST API
I am trying to let a user change their password via the API. What it looks like here is that I can send a POST request to the users endpoint with their user ID at the end, sending the new password in ...
0
votes
1
answer
27
views
How to allow users in wordpress to switch between two assigned roles e.g. Candidate & Employer
I am using Careerfy Theme for wordpress which is basically a job board and has Candidate and Employer User roles set for new registrations.
I want registered users to be able to switch between these ...
0
votes
1
answer
86
views
Redirect WordPress page to the latest created post by the logged in author/user
I have a basic WordPress code that redirects someone to the last post type created on the site, in this case is the "case" post type:
<?php
/*
Template Name: Redirect
*/
$args = ...
1
vote
2
answers
3k
views
When I try to login in wordpress it is showing "USER Doesn't Exists"
The main Issues is that I am entering the email address & password that I used in creating my WordPress site in digital but It shows that the email address & username doesn’t exist even I ...
16
votes
7
answers
42k
views
How to check if a user exists by a given id
Is there any way to check if a user id exists? I want to create a function similar to username_exists() but which returns if the id exists or not.
0
votes
1
answer
138
views
Email notification when registred user clicks a link/visits page
Wordpress- I need to get an email which signed up user visited/clicked on link/button/or visited specific page. Email needs to tell me at least their username, or something from sign up form from User ...
1
vote
2
answers
1k
views
No user found when using REST API
When I use a REST route whilst logged in, and call wp_get_current_user(), no user is found. However, the request method, eg POST is processed without issue. Example REST route registration.
...
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
632
views
How to make WordPress 'editor' role to list/view/add/edit users only with the role 'author'?
I have added some extra capabilities to the existing 'editor' role in wordpress with:
function add_uedit_caps() {
$role = get_role('editor');
$role->add_cap('create_users');
$role->...
0
votes
1
answer
80
views
Add custom css to specific user
I need help with something for my wordpress site. I want to add custom css to a specific user. For example, user B. but I couldn't do it.
Here I tried the following css code:
div [user="id"] ...
0
votes
1
answer
2k
views
How to add registration date and last login date to user list page
To assist with managing a WordPress install with a large number of users, is there a simple way to include the date the user registered and they date they last logged in as additional columns on the ...
0
votes
1
answer
77
views
Does Wordpress Super User or Administrators can create and edit post and media on behalf of a user
For my project I need to administrate user post and media without access to it personal account.
So I must be able to create and edit a post (by is user name) before or after it has been created on ...
49
votes
6
answers
58k
views
Getting a List of Currently Available Roles on a WordPress Site?
When writing WordPress plugins there is often a need to set up options for which roles on the site have access to certain functionality or content. To do this a plugin dev needs to fetch the list of ...
0
votes
0
answers
20
views
Condionally/limited emails from system (cantact-form, registration, passwd reset)With
With:
add_filter( 'wp_mail_from', 'my_mail_from' );
function my_mail_from( $email ) {
return "[email protected]";
}
add_filter( 'wp_mail_from_name', 'my_mail_from_name' );
function ...
0
votes
1
answer
224
views
Wordpress change role from administrator to author by itself (automatically)
do anybody know this kind of phenomenon? I do not have any user managing plugins installed in my WP, but after some interaction e.g. editing pages or creating postings (its not matter) WP changes for ...
12
votes
9
answers
44k
views
Get multiple roles with get_users
I've got some code like this:
$query_args = array();
$query_args['fields'] = array( 'ID', 'display_name' );
$query_args['role'] = 'subscriber';
$users = get_users( $query_args );
foreach ($users as $...
1
vote
1
answer
1k
views
Display custom user profile fields in wordpress
New to wordpress development. I was trying to solve the problem of adding extra fields to my wordpress logged in subscriber user profile area, and also echoing the field values in my custom page ...
0
votes
1
answer
100
views
(How) does WordPress protect direct access of user data?
I am setting up a WordPress with a user system.
User information (names, profile picture) of all users should be private, and only accessable when logged in.
The "Ultimate Member" plugin ...
20
votes
3
answers
12k
views
How to allow an user role to create a new user under a role which lower than his level only?
I have three extra roles in my site.
Doctor
Receptionist
Guest
those roles are added by following code:
* adding Doctor role */
$doctor_role = add_role('Doctor', __('Doctor'), array('read'=>'...
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 ...