Questions tagged [user-roles]

Names for a set of user capabilities.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Restrict admin pages for specific user role

I have created new user role "advertiser" and added some capabilities: function prefix_add_user_role() { add_role( 'advertiser', 'Advertiser', array( '...
0
votes
0answers
7 views

On action, change user role

wonder if you can help me. I'm trying to get an action (geodir_after_save_listing) to change a user role. Basically, in Geo Directory, when the user submits a business listing, I want to change their ...
0
votes
1answer
19 views

Custom shortcode for displaying user based on a role parameter

I've created a plugin that with a shortcode displays all users with the custom role "ansatt". This works perfectly fine, but I'd like to be able to set the role as a parameter within the ...
0
votes
0answers
18 views

User role and capablities only for 1 plugin

What if i want a user called Marketing only to see the Slimstat plugin? The rest of the admin menu should be invisible for him. (for a external marketing agency that should see our stats but only our ...
0
votes
2answers
24 views

Lock out all WordPress Administrators except two specific users

I used the snippet below to lock out all administrators and editors except myself if ( is_user_logged_in() ){ $current_user = wp_get_current_user() ; if ( in_array( 'administrator', (array) $...
1
vote
0answers
34 views

My subscriber has the “edit comment” capability but can't edit comment

When i use the wp_get_current_user function to display all informations about my user (subscriber), it shows that i can edit comment : I tried to display an edit comment button next to each comment ...
1
vote
1answer
70 views

List all private pages user has access rights to read

I am trying to list all private pages that user has access to read. To explain in more details, below is the initial setup: Each user has a specific role created and assigned only ability to read ...
0
votes
0answers
15 views

create wordpress website for tutors

I am new to wordpress and I want to create a website to connect students to tutors/teacher. The idea is that each tutor can register and then make his/her (one page) profile with his/her resume (a few ...
0
votes
0answers
33 views

adding new role with custom capability

I am trying to add new role with custom capability here is what I have done so far : add_role('event_manager',__( 'Event Manager'),array( 'read' => true, 'create_posts' =>...
0
votes
0answers
8 views

Default product image by user role

I would like to replace the default product gallery and the default product thumbnail if user have VIP user role. The vip thumbnail and gallery images are in 2 ACF fields: vip_thumb vip_gallery Now ...
0
votes
0answers
14 views

Same user Caperbilities have different abilities

I am using Publish Press and WooCommerce, but this is not a question related to these plugins directly, this is a question as to how WordPress manages capabilities. Why is it that when I edit the ...
0
votes
0answers
15 views

unfiltered_html issue with custom guttenberg block on multisite network

i have a custom guttenberg block that creates a grid of icon buttons using the package react-fa-icon-picker, it works fine if the user is a super-admin, but for editors and admins it doesn't work ...
1
vote
0answers
16 views

Wordpress multiple custom post types capability conflict in a single menu

I have been trying really hard to find an answer to resolve a issue I am having but not successfull so far. So If there is a solution exist, Please just give me the link / reference to it. Let me ...
0
votes
0answers
50 views

How to give plugin access to specific role(s)

How do I restrict plugin access to a specific user role? I wrote/installed a simple plugin that's listed in the left navbar in wp-admin. However, I'd like to only have it show for specific roles. I ...
0
votes
1answer
16 views

Add a second role when registering programmatically

I would like to know if there is a way that at the time of submitting the registration the user programmatically add a second role, so he would have the default role and the second, is it possible? ...
0
votes
1answer
39 views

Set user role, if an specific role created an user

Im Trying to set an user role. if an specific user role (sales-agents) create an user. the created user should have the role b2b instead of customer here is my try: add_action( 'init', '...
0
votes
0answers
15 views

Using REST API for custom users registration / login and user profile displaying and search

I'm reading about REST API of wordpress and I want to use it to login and register users. I need to set the user role based on the user choiche and add some information before the registration is done....
0
votes
0answers
8 views

Allow a user to edit subscriber user profiles in FrontEnd

Hi I'm trying to find a way or a plugin to get a certain user to only edit the profiles of the subscribers users in FrontEnd, at the moment I'm trying with Profile Builder, but I can't find the way to ...
0
votes
1answer
30 views

Update user role for expired membership

Is it possible to use a function in functions.php that would automatically change user role when a membership goes from status "active" to "expired" ? For example : if an active ...
0
votes
0answers
12 views

How do I add a custom capability to a user role that would allow the user to add/remove specific users and not the entire list of users?

This may be slightly confusing but I will do my best to explain. I am trying to create a capability that would allow a user to add users to our site. They would be able to view and delete these users ...
0
votes
0answers
7 views

select custom user role on registration

I need to implement some custom fields and custom user roles into the registration process of wordpress. Basically I want that the user is able to select between two roles during the registration and ...
0
votes
1answer
23 views

Add user role to generated plugin

I used the generator by Jeremy Hixon to create an options page but this page is only accessible to the admin user. I would like to make this available to the editor. I have looked to add_role but I am ...
1
vote
1answer
37 views

If post by specific role different css to everyone

So i have searched alot but cant find a solution. Every solution which i find is changing css only to that specific role not for everyone else. Basicly i want to do this: If user role contributor then ...
0
votes
0answers
22 views

Block access to plugins.php for custom role

So I have a custom role and I'd like to block access to the plugins.php page without using a plugin. I can remove pages from the admin menu with my functions file but not sure how to restrict access
0
votes
0answers
11 views

creating custom user roles in Wordpress completely hides post type when logged into custom user role

I asked about this a while ago https://stackoverflow.com/questions/66231525/wordpress-custom-user-roles-edit-others-posts I changed my approach but it still doesn't work. I've been attempting to ...
0
votes
0answers
19 views

URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site

I have a site that needs to only allow people who are logged in and have at least one of 3 possible roles to have access to the pages of the site. I'm not new to programming, but am new to both php ...
0
votes
0answers
17 views

Is there a way to allow users with “Subscriber” user role to access media library in backend and frontend

Is there a way to allow users with "Subscriber" user role to access media library in backend and front end with image editing ability? Subscriber can access the media library but unable to ...
0
votes
0answers
18 views

Update user role after Memberpress transaction

Currently working on a Memberpress site that offers courses for a monthly subscription. Certain user actions on the site will update their role. I'm looking for a solution for reset the role back to ...
0
votes
0answers
18 views

I want to select all users who have “Contributor” role and assign a custom role “edd_subscriber”

I'm trying to build a script which can select all the users from database who have assigned role "contributor" and then change their role from "contributor" to "EDD Subscriber&...
1
vote
0answers
29 views

Custom post type capabilities require “create_posts” to access the edit posts list page

I have a custom post type and a custom user role that I want to be able to do everything but delete and create this post type. However, this user role can't view the dashboard's list of posts for ...
2
votes
1answer
29 views

How to not let a user with a new role edit users that have administrator role?

I just found out how to create a new role on Wordpress. So, I did something like this: function suporte_role_creation() { remove_role('suporte'); add_role( 'suporte', 'Suporte', array( ...
0
votes
1answer
28 views

How I can change the required capability for an admin menu without editing the plugin file?

I need to change the capability required for an added admin menu page. By default the plugin added the capability manage_options which I need to change. How can I change this without editing the ...
0
votes
0answers
29 views

How to show specific admin menu to specific user role?

I hope you are well how I can show a specific admin menu to a specific user role already created by the WooCommerce shop manager. how to show only a custom specific plugin (admin menu page) in this ...
0
votes
1answer
23 views

Load user by specific role

I need to load only the subscribers $args = array('role' => 'Subscriber'); $subscribers = get_users($args); but with this, it returns also the users that are subscriber AND other role (I need to ...
2
votes
1answer
32 views

Why does current_user_can('edit_posts') return true, but current_user_can('edit_post', $post->ID) returns false?

I have a plugin with a custom post type (with 'capability_type' => 'post') and a custom user role (test_user). When I check if a user is allowed to edit a post (of the CPT and which this user ...
0
votes
0answers
21 views

Allow contributor user role to perform copy operation PHP

I have posted the issue on Stack Overflow but didn't get any solution. So now I am posting here. I want to allow contributor user role can copy file from one location to another location. I am using ...
0
votes
0answers
18 views

Wordpress - add_cap( 'edit_others_posts' ) for registered custom post types

I need to allow a certain custom user role (in this particular case, engineers) to be able to edit others posts within that custom post type. I'm trying to do this with add_cap( 'edit_others_posts' ) ...
1
vote
0answers
7 views

I want to submit multiple users if checkbox is checked

The following code is getting all terms and see if any one of them is checked or not. If any term is checked a form should show under the selected checkbox with email, the username(auto-generated) and ...
1
vote
3answers
68 views

Enable specific CSS Code for Visitors and specific Roles

how i can enable an specific css code for visitors and an specific user role for example this code: input[type=radio] { border: 1px solid !important; }
0
votes
0answers
24 views

Easily adding multiple existing users to a multisite site

I manage a multisite network for a school. The sites are private (password protected), but users within the network should be allowed to access other sites as subscribers. (i.e. all students in a ...
0
votes
1answer
28 views

Assign user role by text field in Wordpress (Woocommerce) [closed]

I have a virtual store with woocommerce where I use the USER REGISTRATION plugin to register new customers. This plugin allows the creation of custom fields. I created a custom text field called "...
-1
votes
1answer
30 views

I want this code to work only for Authors AND Contributors

I want this code to work only for Authors AND Contributors Please modify this code for me using if ( ! current_user_can( 'manage_options' ) ) { //Hide Menu Options in Admin Section add_action('...
1
vote
0answers
15 views

Protect sequence of pages with same password for each of two groups of users

I'm currently creating a home page (learning environment) with wordpress. It should serve for an experimental study with two conditions. Based on the condition a participant will be assigned to, he or ...
0
votes
0answers
15 views

User Role Hierarchy for Product Visibility

How to establish Product Visibility Hierarchy in Woocommerce? I have created Custom User Roles, extending Author Role as Importer/Manufacturer, Distribuitor and Retailer. I have enabled Authors for ...
0
votes
0answers
13 views

Need help with woocommerce roles

i need help with woocommerce. The question is: How can i make a role for every user to see only his orders and not orders from other customers? Thanks
0
votes
0answers
39 views

Allow user to select role from front end edit profile form

I have a front end edit profile form working fine (thanks to previous answers) I'm having trouble adding a form element that lets the user change their role. I've tried adding: ...
0
votes
0answers
18 views

Allow user select role in wordpress default registration without plugin

How do I allow user select role, like 'Contributor' and 'Subscriber' In Default Wordpress Registration Page Without Plugin
0
votes
3answers
46 views

(solved) getting post author's user role

we can use $user = wp_get_current_user(); if ( !in_array( 'administrator', (array) $user->roles ) ) to get the user role of the viewer. but i want to ignore who views. i want to get who writes ...
0
votes
0answers
9 views

Hide pages specific user can't edit

I am using roles to allow specific users to edit pages. When a user is logged in and clicks the pages menu they are only allowed to edit those specified by their role. However, all of the pages on the ...
0
votes
0answers
10 views

User roles established by site entry URL/cookie possible?

I have a use case to present different content and products to different, casual visitors of the general public WITHOUT them first creating an account or needing to login (if returning), preferably ...

1
2 3 4 5
27