Questions tagged [user-roles]

Names for a set of user capabilities.

0
votes
0answers
7 views

Sub user management / administrator able to see related users

Ey guys, basically i have been looking for a way in which i can allow a specific user role / administrator to list and manage only it's related users. Im not 100% sure in how to make it. Ive been ...
0
votes
0answers
17 views

User Role Capabilities for WordPress Gutenberg Blocks

As I am switching from ACF to Gutenberg, I am looking for a possibilty to set specific capabilities for my users. In my common projects, my clients and content managers usually have "Editor"-Accounts ...
0
votes
0answers
24 views

Assign user capabilities to a Custom User Role not working

I have a New User role called client admin. This role must create, list, edit, delete, remove user for the site. I add the following code the Site. add_role( 'client_admin', __( 'Client ...
-1
votes
1answer
21 views

Get users query makes the site loading time too big?

I'm trying to get the top 10 users in (specific roles) by the highest post views, but this code makes the site loading time too big, and I don't know why! I'm highly appreciated your help. <?php ...
0
votes
2answers
26 views

Security Issues with custom user role or changing core role capabilities?

I have a scenario where I need a editor like role but with extended capabilities where they can access woocommerce orders,products and user page. If I would to create a custom role or change the core ...
0
votes
2answers
15 views

User roles not displaying

Can anyone explain why I cannot see the role from the code below: $userID = get_current_user_id(); $user = get_userdata(userID); <?php echo $user->roles; ?> but I can see all the other user ...
0
votes
0answers
23 views

how to make author to write comment only his own posts?

i want restrict my registered authors to write comment to other posts except his own posts. Is it possible? I have no idea how to do it. May be need conditional logic but how?
0
votes
0answers
12 views

is_user_logged_in() working only for admins and not other roles

I made a custom admin bar that is displayed only for logged in users. But I just noticed that with "is_user_logged_in()" function it works only for admins and not contributors or spectators. Here is ...
0
votes
3answers
37 views

Multisite - maximum number of users with specific role

Is there any plugin or script where i can use to define maximum number of users with a specific role on subsite in a multisite network? I'm offering cloud helpdesk wordpress and pricing is based on ...
0
votes
0answers
22 views

Conditional actions by user role

I am making a paid subscription site using Paid Memberships Pro and I need to make some custom actions by user role. All I have found is conditionals for current user, so I figured I can check ...
0
votes
0answers
11 views

How to Allow Custom Created Roles to Access Specific Pages (or subdirectory)

This seems common but I can't seem to find a solution. Trying to avoid using a plugin because this feels straightforward. I'm looking to create three user types, I want each to be able to access ...
0
votes
0answers
9 views

Hiding specific navigation menus from specific roles in admin panel

So what I'm trying to do is make 13 different user roles on my website and I have 13 different navigation menus. Each of these menus is displayed on the front end on separate pages. I need to let ...
0
votes
1answer
15 views

load CSS only for administrators on backend

I am trying to load a custom styles sheet but only for administrators My code works fine by itself: function admin_style() { wp_enqueue_style('admin-styles', get_template_directory_uri().'/admin....
0
votes
0answers
11 views

Restrict user to edit only edit a certain menu

I'm using a plugin (User Role Editor) to take care of the user roles. This works fine, except that you can't give a user acces to only a certain menu. I have two menu's in my website. One 'main' menu ...
0
votes
3answers
50 views

Redirect after login based on user role (custom login page)

I created a custom login page and everything is OK but there is an issue. I want to redirect users to different pages based on their roles after login. My code is below but I do not know why it is not ...
0
votes
1answer
24 views

Custom roles and capabilities media not work right

Help with new user wordpress capabilities and roles custom. The media not work upload and display images in galery. image error: https://i.imgur.com/1bPbcAm.png code: if ( get_role('user_products')...
0
votes
0answers
17 views

How add user role level in comments?

I have a forum site. I want to display user role badges in comment section. What function code should be add?
0
votes
1answer
22 views

Shortcode for Listing Users from Meta Value?

Trying to display a list of users that match certain criteria using a shortcode with parameters. Here is what I have so far, but for some reason it does not display anything. I am pretty new at this ...
0
votes
1answer
20 views

I want to show post details based on roles user login

I have a custom post type called support I also have two roles: manager and employee. Now I want to show post details based on roles. plz help me out. custom post code // supports add_action( '...
0
votes
1answer
11 views

Display specific post categories to specific user roles

I'm creating a learning website on WordPress. I've already created different user roles based on the company's roles (eg. Agents, Managers) but I want every role to only be able to see specific posts ...
-1
votes
1answer
16 views

Limit user access to installing/configuring a plugin?

I'm hiring a freelancer to install a plugin for me and setup a few of the plugin's more complicated settings. I don't know him personally and would like to limit his access, as there is sensitive ...
0
votes
0answers
27 views

How to give custom roles the capability to edit one Menu instead of every Menu

I would like to have a custom user role that can edit the Menu items under the Appearance tab. But I don't want my custom role to have the ability to edit every menu on my WordPress site. I only want ...
-1
votes
1answer
40 views

Restricting users to a specific front end page [closed]

I am looking for a way to restrict users of a certain role to only be able to access one page on my wordpress site. When a user of the role logs in they should be redirected to the page and they ...
-1
votes
1answer
38 views

Forbid certain users to access a specific page

I want to build a blog where every user is allowed to post something (only text) after a successful registration. However, a user should only access other contributions from users who have uploaded at ...
0
votes
0answers
28 views

Custom Email based on User Role at Registration

I need to create a custom registration email for different roles that a user signs up to. Here's what I've done so far, a lot if it are copied as I'm still learning: /* * Plugin Name: Custom ...
0
votes
0answers
5 views

Restrict authors from viewing each other comments in the post

As the title says im trying to find a way to restrict what authors can see. Im using custom posts and Authors can view each other posts but how to hide the comment section if the post is not owned by ...
0
votes
1answer
21 views

Public WP website with one area just for members

I want to create public WordPress website (for a sports club), but with one closed area just for the members. The public part of the site will have the usual pages: club info, photo gallery, contact ...
0
votes
1answer
16 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
0answers
8 views

How to create a manage user page for a specific role in wordpress admin area?

I need all controls like Add/Edit/Delete and pagination as well. $user_query = new WP_User_Query( array( 'role' => 'Owner' ) );
0
votes
0answers
16 views

How to hide 'Submit for Review' button for a specific role in Wordpress?

Currently, I've got 2 roles which are Contributor and Editor, both of these roles are able to submit for review, but I only want Editor has this button and hide it for Contributor.
0
votes
1answer
47 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 ...
1
vote
1answer
20 views

New user is assigned 2 roles: customer and superadmin

I've a question about user role in WordPress. After new user already registered. They can access with superadmin and customer role. They can access to /wp-admin/, create blog, etc.. For my ...
0
votes
2answers
21 views

Publishing post strips custom html element when user is not admin

This phenomenon occurred after updating Wordpress from 4.9.10 to 5.1.1. I'm using the plugins TinyMCE Advanced, Classic Editor and Advanced Custom Fields PRO. The wordpress installation has the roles ...
1
vote
1answer
26 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 ...
0
votes
1answer
25 views

Adding additional roles on registration

I'm trying to add an additional role for a user when they register if they register as a specific role. Here is my function: function add_secondary_role( $user_id ) { $current_user = ...
0
votes
1answer
16 views

Wordpress add_rewrite_rule redirection match GET variable not passing through to custom template

My target: Create a page template in theme (page-expert.php) following the guide Page Templates. Create a blank page with the template. The above page will show the profile information for certain ...
1
vote
0answers
48 views

WooCommerce Customer Role Delete Custom Post Type

WooCommerce customers are creating custom posts using Gravity Forms and then the customer is assigned as the author of the post. The custom post type is set up using the CPT UI plugin. I have this bit ...
0
votes
1answer
16 views

After setting up a new Role, CPT and capabilities, the new role can't see the featured image

Registering the custom post type: $labels = array( 'name' => 'tananyags', 'singular_name' => 'etananyag', 'menu_name' => 'E-Tananyagok', 'name_admin_bar' => 'Add new', 'add_new' ...
0
votes
0answers
28 views

Role and Capabilities: How do I allow user role to access theme options without enabling 'manage_options'?

I'd like to allow a certain user role to access the theme options only. When I tried this in functions.php, nothing happened: $limitedadmin = get_role('limitedadmin'); $limitedadmin->add_cap('...
0
votes
1answer
39 views

Email notification for editors only

I would like to send an email to all editors of my blog when a new article has been published. I found many plugins but I want to solve this problem without plugins. In addition, I found a tutorial to ...
0
votes
0answers
18 views

Allow Block Editing By User Role

I am looking to see what options there are for Gutenberg (or via a plug-in) to allow users with certain roles to edit blocks on pages. Here is a general layout. Multiple pages are in the site, and ...
0
votes
1answer
24 views

Prevent Subscriber Role to login

How can I prevent a Subscriber to login? I want to prevent the user role.
0
votes
0answers
40 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
36 views

underscore not allowed in role slug?

I created a role, 'CFI_G' in a plugin activator: if(!role_exists('cfi_g')){ add_role('cfi_g' , 'CFI-G', array('edit_gc_instruction')); } else { (note the underscore in the slug) It appeared to ...
1
vote
1answer
57 views

Allowing Custom Capability to Manage Plugin Options

Question Is it possible to give a custom capability the ability to manage the options of specific plugins? Background I am developing a suite of plugins, a main one with some additional modules. ...
-1
votes
1answer
50 views

How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions

I have a Wordpress/WooCommerce webshop and I use WooCommerce Subscriptions. I want to disable the "Upgrade or Downgrade" button in My account > My Subsccriptions for users which have a specific user ...
0
votes
0answers
30 views

Plugin admin menu

I have a question currently I am using a table generator plugin, I want to allow users with the editor role to view this plugin menu on wp-admin. I understand manage_options capability ONLY Allows ...
0
votes
0answers
62 views

Add Media button of WP_Editor on custom role profile page not working

I have a custom role defined which has a separate profile page in the front-end. In the profile page there is a wp_editor with Add Media button. But the image is not being attached. This is the error ...
0
votes
0answers
16 views

Multiple useres editing specified content

I work for a nonprofit with weekly courses for kids. Every week the course teachers update where and when next weeks course will be. We have about 10 courses every week. So the teachers need to be ...
0
votes
0answers
85 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 ...