Questions tagged [user-roles]

Names for a set of user capabilities.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 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
12 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 ...
  • 1
0 votes
0 answers
6 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 ...
  • 101
0 votes
1 answer
37 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 ...
  • 3
0 votes
1 answer
23 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', '...
0 votes
0 answers
16 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
29 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
20 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
274 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
39 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
48 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
25 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
15 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" ...
  • 46
0 votes
1 answer
42 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 ...
  • 3
0 votes
1 answer
48 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
73 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
37 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 ...
  • 1
0 votes
0 answers
28 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
24 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 = ...
  • 51
0 votes
1 answer
60 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
21 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 ...
  • 1
0 votes
2 answers
26 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?
0 votes
0 answers
61 views

Front-end ajax problem all users and guests getting a 302 redirect when accessing wp-admin/admin-ajax.php

I want to wp ajax for all users frontend but showing error of 302 Found and calling home page except admins. I looked this thread and added the code below to the functions.php of my theme. function ...
  • 1
1 vote
0 answers
16 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
63 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 ...
  • 13
0 votes
1 answer
27 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', $...
  • 1
0 votes
0 answers
32 views

How to assign a custom gender to a user role?

I'm looking for a way to assign a custom gender I created to a user role. I have also created very specific custom roles for this, but for the example, let's say that I would like as soon as a user ...
  • 1
0 votes
2 answers
27 views

Adding a new role with administrator's capabilities

I'm trying to add a new role to my website that is based on administrator's role. I want my new role to have all the capabilities admin has. Problem is, when I log in with my new user, I can't access ...
0 votes
1 answer
21 views

Redirect user based on role when they try access a particular page

Please how can I redirect a user base on the role when they try to access a particular page? I would need the code to do this, please.
0 votes
2 answers
372 views

Check if specific role exists

I'm trying to write a function that checks if a specific role exists. I found the following code on the web but it doesn't work for me: function role_exists( $role ) { if ( ! empty( $role ) ) { ...
0 votes
0 answers
12 views

Get users by rôle in a list

i'm using masterstudy theme in wordpress and i made some changes by adding project on each course so i have a field named company name on the project section where i have to write project povider (...
0 votes
0 answers
14 views

Adding plugin editing capability for Author

I am new to php environment. Any idea how we could enable plugin editing roles and capabilities for Author or another scenario could be adding as sub-admin with limited roles. Any help would be ...
0 votes
1 answer
283 views

User Capabilities are not available in WP REST permission callback?

I want to only permit the execution of specific admin tasks for users who are currently logged in to the wp admin panel (via is_user_logged_in) and who have a specific capability (via ...
  • 421
0 votes
1 answer
58 views

Block user roles from accessing the WordPress dashboard

I want to block multiple user roles from accessing the WordPress dashboard, I have a custom role, and I want to block it along with other roles, but I don't know how to edit the code. the code below ...
  • 15
0 votes
0 answers
25 views

How do I modify the user role 'subscriber' to allow the user to delete posts

I've created a form to allow users to create new posts of a custom post type user-posts. This works well, any registered user of any role can create a new post of this custom post type. I created an ...
1 vote
0 answers
22 views

'upload_mimes' filter seems to be restricting viewing/downloading as well

I am trying to allow administrators to upload SVG files using upload_mimes filter. function custom_upload_mimes( $mimes ) { // Allow additional mime types for administrators if( ...
0 votes
1 answer
80 views

Execute PHP code only with specific user role

I have a WordPress website with woocommerce and I want to set a minimum order quantity for products. I have found code online which does exactly what I need it to do and it works perfectly.(the code ...
0 votes
1 answer
19 views

Change user role when user's first post gets published

On my websites the contributors (user role contributor) are allowed to post posts. All their posts are not published automatically (these posts are with pending status). After approving their first ...
0 votes
0 answers
65 views

can't create user without email for an author after converting single site to multisite

We're converting a single site to multisite, and in the process we're seeing something strange with users. Previously, we could create and update users to use as authors that don't have an email ...
  • 111
0 votes
0 answers
26 views

Wordpress user role with create user capability?

I want to create a user type (Let’s call it “clinic” which is similar to editor role in wordpress) but with permission to add_users /create_users capability. I wanted to limit that capability of this ...
0 votes
1 answer
24 views

Does wordpress support natively the concept of logging-in users? (not admins, but users of the website)

I need to create a small members area, probably for about 1000 users, not more. I want to set private information there, forms, interaction, etc. More in particular it'll be for "providers" ...
0 votes
1 answer
24 views

Role capabilities issue

I need some help with capabilities for a CPT. I register a new CPT with a capability type 'agenda'. To do this I use the code below in the register array 'capability_type' => 'agenda', After ...
  • 27
0 votes
0 answers
25 views

Redirect Page ID, based on logged-in User Role

I am trying to accomplish the following in WordPress via the functions.php file. If user is "This Role" & If "Page ID#" is being visited then "Redirect" to this &...
0 votes
0 answers
19 views

How to fix the Post Preview Button (CPT & map_meta_cap)

I'm trying to create a custom post type that can be edited by users with a custom role (as well as administrators, editors and authors). Althought the idea for the users with this custom role is for ...
0 votes
0 answers
13 views

Restrict Custom Post Type per role in Dashboard

I would like to set up some restrictions on how some roles can access given posts to edit in Dashboard. I have a custom post type affiliates having 2 nested levels. Custom Role User Editor should be ...
  • 824
0 votes
1 answer
40 views

Retrieve user roles but exclude default roles

I am currently using the wp_roles() function to retrieve all user roles available like this: <?php foreach (wp_roles()->get_names() as $role) { echo translate_user_role( $role ); } ?> ...
  • 203
1 vote
0 answers
28 views

How to change or add user role after getting post request data about pay? [closed]

How to change or add user role after getting post request data about pay? qiwi2.php file in theme folder: <?php include($_SERVER['DOCUMENT_ROOT'].'/wp-load.php'); $qiwi = [ "public_key&...
3 votes
0 answers
30 views

Locking Down Wordpress Application Password Permissions / Capabilities

I am working on a Wordpress installation where we recently decoupled the frontend into a NextJS application that is no longer hosted on the same domain as the admin. We are accessing data etc through ...
1 vote
0 answers
209 views

Parent User and Child User - relate users

I need to create a system in which I have 2 types of users: Company User (C) and Employee User (E). I need C to be able to register as many E as necessary and for C users to be able to publish ...

1
2 3 4 5
28