Questions tagged [user-roles]
Names for a set of user capabilities.
1,377
questions
0
votes
0
answers
19
views
How to add default folders to Every registered User when registered in WordPress site?
I need some guidance on my work. As soon as the clients register on a WordPress site. I want the clients to see 4 folders by default: 2002 2003 2004 and Firm Documents.
Once the clients activate their ...
0
votes
0
answers
13
views
coauthors_plus_edit_authors to display metabox based on author caps
Need to display the coauthorplus metabox with author capabilities.
On the documentation of the plugin they say its only with super admin and editor that the metabox is available.
Any idea to add a ...
0
votes
1
answer
22
views
Administrator user cannot access dashboard after localwp import
This is the 2nd time this has happened in the past few weeks so I thought I would try and get some ideas on how to overcome. There are a few others in the localwp community that have had the same ...
0
votes
0
answers
16
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
0
answers
29
views
How to create Wordpress login for different users, with different roles?
I need to create a web page. where the user / group of users, after logging in through the portal (using the provided login credentials), will be redirected to the relevant page with their own ...
0
votes
1
answer
49
views
How to make my logged-in user-role shortcode displaying name instead of slug?
I am trying to get my frontend to show the role of a logged-in user via Shortcode. I have the Shortcode functional (see below) but it displays the slug and not the real name in the frontend. This is a ...
0
votes
1
answer
44
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 ...
1
vote
1
answer
82
views
disable adding new tags on the edit and add post
I use the admin menu editor plugin.
I have not allowed editors and authors to access the tags section
But they can add a new tag in the post edit section
This is not good for our site
We want them to ...
0
votes
0
answers
13
views
Custom User Role not working
I've created a custom user role that I want to only be able to access a CPT Job Listings
Below is my code for the custom user role ( this is on a multisite network ) which I have added to my themes ...
0
votes
0
answers
17
views
What is the difference between unmoderated and unapproved users?
I recently ran into these two user categories/roles on an existing site for a new client. Most of my client sites are more informational than transactional, so I'm guessing that the categories/roles ...
0
votes
1
answer
57
views
How can I display customizer's "Additional CSS" to administrators and editors (in multisite)?
In my multi-site WordPress, administrators and editors don't see the Additional CSS section in the customizer. I would like them to have access to that panel. Only super-admins can see the additional ...
0
votes
0
answers
10
views
Limit the content cappabilities for user roles of subscriptions
I need guide to builld a subscription page payed by monthly having (bronce,silver,gold) subscriptions as a roles users.
the bronce role can create and edit one an only (1 template page ) that page ...
0
votes
1
answer
46
views
Add another user role based on a defined input field in Wordpress (Woocommerce)
for a WooCommerce shop, the roles customer and corporate_customer are primarily used.
As soon as a customer registers and enters a tax number in their billing address in the optional field (ID: ...
-1
votes
1
answer
60
views
Show only those pages that are created by the specific logged in user in WordPress
In WordPress, I created a new User role called "Customers" to only see the pages in the wp-admin Dashboard that only that role has created and not all the pages that are created by other ...
0
votes
1
answer
26
views
What is the correct way of validating running code when a particular role accesses a screen?
I'd like to run a series of actions if a particular role accesses a specific screen. For example,
if( is_user_logged_in() && ! current_user_can( 'activate_plugins' ) ) {
if( isset( $...
2
votes
0
answers
39
views
How to protect content from public users and limit access to certain roles in WordPress 2023?
There are hundreds of content protection plugins and role managers, however in my current case I need a custom solution.
The customer wants that only "logged in users" are to be able to read ...
0
votes
1
answer
39
views
Why is user_can_access_admin_page() an undefined function?
According to WordPress Developer Resources, the user_can_access_admin_page() function is still active and valid...
https://developer.wordpress.org/reference/functions/user_can_access_admin_page/
...
0
votes
0
answers
68
views
How to set default value for fields added to user profile using ACF
I am adding several fields to the user profiles using ACF, example field setup with location set as user profile:
...
array(
'key' => 'field_user_created_id',
'label' => '...
0
votes
0
answers
9
views
How to have certain products show for only certain users (Not roles)
I am not a coder so this has been a difficult journey for me.
I run a giftware wholesale company and am trying to have it so different retailers can have their own custom product show up in the ...
0
votes
0
answers
18
views
Limit post type to 1 per user
I am using the events calendar pro, for my organization I need to limit the number of organizer profiles per Wordpress Account to 1.
I tried the following way in the functions file to limit user from ...
0
votes
0
answers
53
views
How to redirect non admin user after login
I have a custom user role on the site. I also have a login hook to redirect users to the home page. When an admin/editor logs in this works fine (although ultimately I would like them to redirect to ...
-1
votes
2
answers
62
views
Redirecting by role from a button
We have a button at the top of our site where users can quickly get their account information, but we need to redirect them to different pages based on their role.
Is there code I can add to this ...
0
votes
0
answers
10
views
Problems with the navigation menu
I detected this problem with google speed.
on the desktop / accessibility side
How do I solve this problem?
If I disable the navigation menu, the problem disappears.
Where and what should I add?
The ...
0
votes
1
answer
188
views
Block Gutenberg Editor manually by User Roles with a Filter with code
This is working perfectly for me but, is this an acceptable WP way to do it? Just trying to check that based on user role that the Gutenberg Editor blocked from showing up, like when creating a post, ...
0
votes
0
answers
70
views
User roles empty
I have exported a website database from another server.
After performing the needed search and replace, I have imported into a new database that I am trying to set up on a different server.
Problem is,...
0
votes
0
answers
35
views
Custom Admin Menu Report for Specific User ID
I've been thinking for generating a custom revenue report for each user ID with an 'author' role monthly, which would be displayed on the backend.
All my online users must be able to view their own ...
0
votes
0
answers
19
views
Filtering custom post admin listing page elements based on acf user field
I have the following problem. I have a wordpress user role 'uzletkoto', which I created with the user role editor plugin and set its rights. I have a unique post type 'partner', which has a user field ...
0
votes
1
answer
129
views
Wordpress: New user role which is ONLY allowed to manage media
I would like to have a new user role (or restrict a role which is already available from Wordpress) which can only manage media (upload, delete pictures etc.) in the wordpress backend - every other ...
0
votes
1
answer
94
views
How to add custom user role into wordpress
I added this code snippet to my function.php to create a user but after logging with this role I'm unable to edit the learndash course lessons quizzes...
add_role( 'learndash_content_manager', '...
1
vote
0
answers
50
views
How to create a User Role and give permission to only use Web Stories plugin?
I want to create a new user role "Story Maker" with only the "Google Web Stories" plugin shown in the dashboard for the user to create and publish stories.
I don't want the user to ...
0
votes
0
answers
268
views
Remove My Account Menu items in Woocommerce based on user roles
I need to be able to unset or disable certain Myaccount menu items in Woocommerce Dashboard based on user role. So for example show "orders" menu for customers (role) and not show menu &...
0
votes
0
answers
36
views
Order Status based on User Role
Is there a plugin or snippet that the order status will be based on User Roles ?
If a Shop Manager will placed the order it will directly goes ” Processing ” and if Staff / Customer / Guest the order ...
3
votes
2
answers
952
views
Wordpress users roles wp-admin
A friend asked me to Review him wp page left unfinished by the company he contracted, I can't do a backup because on wp-admin page is no visible the settings although I am administrator, dos wp have ...
0
votes
0
answers
238
views
Get all users from role and add to dropdown (select) - wordpress, javascript
I have a shortcode from functions, which retrieves a list of all users from active role. I have managed to get the list into the dropdown list with a little trickery if I wrap a div around the users ...
0
votes
0
answers
63
views
if user role is x - show image - wordpress
I have set up a member portal with ultimate member where users can fill in and submit various forms and then see the answers in a list. Each submitted answer is automatically converted into a pdf.
...
0
votes
0
answers
17
views
edit slider plugin capability for custom_role
I have create a new user role and I have given the following permission.
add_role( 'custom_role',
__( 'Custom Role' ),
array(
'read' => true,
'edit_pages' => ...
1
vote
1
answer
32
views
Wordpress show content if current user get spesific role and spesific meta value
How to make conditional if statement like "Show content if current user get spesific role and spesific meta value", if not.. hide content
<?php if( ( current user get spesific role and ...
0
votes
0
answers
73
views
How might I enable a user to view Draft pages from a different Author, without the ability to edit?
Is there a feasible way to allow a user to view Draft pages made by other authors, without granting them the ability to edit these pages?
As a test, I gave a Subscriber the "edit_pages" ...
0
votes
1
answer
52
views
Send email to user if their role is changed to Author
I would like an email to be sent to the user when their role is changed to Author.
The code below sends an email when a user's role is changed to any role, but I would like it only to send if the role ...
0
votes
1
answer
54
views
Display users by role
I am trying to display users by role, I am using the code below, but I am not sure if this code is correct.. but it works very well on the front page.
<?php
$args = array(
'role' => '...
0
votes
0
answers
195
views
current_user_can() returning true for capability when the user and role do not have the capability
I've been trying to remove the "Customize" from the admin bar by removing the capability from the 'tt_editor' role by adding this to the bottom of the init action function:
$editor = ...
0
votes
0
answers
66
views
Remove default wordpress roles
I'm creating a custom plugin that will add some custom roles to the standard one of wordpress. The roles are added without problems to wp, but I have some doubt. Can I remove the default roles of wp ...
0
votes
0
answers
91
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
25
views
Can I remove WooCommerce specific product categories from shop managers?
Can I remove WooCommerce specific product categories from shop managers, so that they can publish products only in some specific categories.
I tried this, but it's not working.
$user = ...
0
votes
1
answer
105
views
Remove_role not working, gives "Call to undefined method stdClass::remove_role()"
I'm making a special child theme template I'm going to use to match custom roles to a user's subscription. So, this is going to be for admin-only maintenance use.
I made a function where I pass the ...
0
votes
0
answers
34
views
Show only users with the same role in Dashboard user list
I'm trying to see in the dashboard user list only the users with the same role of the logged in user.
For example, i have Admin, Mod and Subscribers roles, when I'm a Subscriber i want to show only ...
0
votes
2
answers
136
views
How to know which editor published a post programmatically?
I have authors posting posts with a custom post type and have users with Editor roles publishing them. How can I get the editors who published them?
1
vote
0
answers
29
views
Increase by one the user counter on specific role
Hi i work on this code to increase by one the total users at users.php (fake counter)
function my_fake_views($args) {
$users_counts = count_users();
$total_users = $users_counts['...
0
votes
0
answers
166
views
User role can't be set
I don't know, but it seems that the new Wordpress version (6.0.2) overrides the role variable in the wp_insert_user function. Before it worked properly, but now the value defined by default in the ...
0
votes
1
answer
28
views
How to lock users account until approvation
I have created a custom role that I've named customer
public function setup_user_roles()
{
add_role('customer', 'Customer', $customer_capabilities);
add_role('moderator', 'Moderator', $...