Questions tagged [user-roles]

Names for a set of user capabilities.

Filter by
Sorted by
Tagged with
0
votes
2answers
31 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
18 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
1answer
41 views

how to make author to write comment on 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
160 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
62 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
39 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
24 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
28 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
31 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
17 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
119 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
37 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
32 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
22 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
20 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
18 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
71 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
69 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
43 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
42 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
8 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
25 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
24 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
21 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
66 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
22 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
39 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
147 views

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

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
86 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
60 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
56 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
19 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
40 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
58 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 ...
2
votes
0answers
105 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
48 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
62 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
410 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
183 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
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
206 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
1answer
290 views

Custom user role not working as expected

I've defined a custom user role in functions.php called "Dashboard Admin" with the capabilities defined below. The site has a number of custom post types- all with capability post- and I'd basically ...
0
votes
1answer
101 views

Updater user with multiple roles

I have searched the net for explanations, but I only find my own question without any real answer. Like this one: Adding multiple user roles dynamically I need to dynamically assign more than one ...
0
votes
1answer
47 views

access the plugins for each role in WordPress multisite

I have created a multi site website.   Several roles using the aam plugin have been created on the website: Special professional And... I want users who have registered on the site to create a site, ...
0
votes
1answer
136 views

Custom Gutenberg Block and unfiltered_html capability

This is more a "am I understanding this right" kind of question: When I create a custum Gutenberg Block that should be used by an user of role Editor(which has no unfiltered_html capability on a ...
0
votes
1answer
63 views

Is there any way to make myself an admin?

Long story short, my client has a website with another company. They didn't make him an admin, but he does have access to the dashboard. I can't tell what his role is, but it's probably along the ...
0
votes
1answer
64 views

How can I disable access to plugin settings in wp admin for other roles

Hi I have a website where people can register a new account and access the site dashboard(wp-admin). But these users can also access settings of other plugins on my site. Is there a way to disable ...

1 2
3
4 5
24