People who code: we want your input. Take the Survey

Questions tagged [user-roles]

Names for a set of user capabilities.

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

Restrict to content by user role + some pages

I need to add users with the following role: initial classes - with ability to see in the admin panel several pages and posts that relate to taxonomy - initial levels, other articles, posts, plugins ...
1
vote
1answer
35 views

Select other roles as custom post authors

I created a custom post type ("Organization"), and I've also created a custom user role ("Representative"). Also, I've ensured that the Representative role has read/edit/create/...
0
votes
0answers
7 views

Change Author user role permissions to enable them to see pages marked “Private”

Change Author user role to enable Authors to see pages marked "Private" I hope that explains what I'm trying to accomplish. I have no need of a plugin, just something for my functions file (...
0
votes
0answers
12 views

Hide users on users.php with a specific meta value

I am using the User Switching plugin in order to allow sales agents to place an order on behalf of a customer. I want to allow sales agents to switch into their customers only instead of all customers....
0
votes
0answers
16 views

Switch to user link shortcode

I am using the User Switching plugin in order to allow sales agents to place an order on behalf of a customer. I have a page called My Customers which uses toolset to return a list of their customers. ...
0
votes
0answers
20 views

Allow Custom Role to edit a custom post type category

I have created a custom role, and have given access to edit a custom post (from another plugin). This works, but the user with the custom role can edit the post, but not set the categories. They ...
1
vote
0answers
18 views

Change name of users parameter called 'Roles'

I'm trying to change the name of the parameter of all users called 'Roles' to 'Levels'. I already tried to find it in the database of the website but nowhere this row with parameters was. Is it ...
1
vote
0answers
21 views

Hiding posts by other users and non-logged in

I've been looking for a plugin that works like a private journal and had no luck. The closest I found so far was this guide from buddyforms. In terms of functionality, this is pretty close to what I ...
0
votes
0answers
9 views

how check user roles with most security

hello everyone i want to check user roles for my custom theme . users according to their roles have different accessibility to site . i check their roles with this code ,I'm worried I did something ...
0
votes
0answers
22 views

Manage roles and capabilities without loads of code

I want to manage user roles and permissions/capabilities. I've tried several plugins, but they save their settings to the database. Since we're running multiple environments with seperate databases, ...
0
votes
1answer
32 views

How to keep the capability of users and disable Gutenberg editor in WordPress?

I disabled Gutenberg web builder/ editor using the following code: add_filter( 'use_block_editor_for_post', '__return_false' ); Somehow this impacted contributor's capability to submit post for ...
0
votes
0answers
8 views

Attribute Posts to User via Custom Field Value

I have a custom user role on my website "reviewer" of which one can view an archive page, just like a normal author, where published posts are attributed to that user and displayed in ...
0
votes
0answers
18 views

wp_update_user very slow

I am changing a user role with a custom endpoint. If the ID is incorrect, it fails right away and I get my error message. If it is successful however, the role is updated in the backend right away but ...
0
votes
1answer
137 views

Display posts with id equal to relationship value

I am trying to solve the following scenario in wp-admin: When an agent logins in he should only be able to see the actors that have a relation with him. (on page: wp-admin/edit.php?post_type=actor) In ...
0
votes
2answers
36 views

How to add custom JavaScript in functions?

I want to write some JavaScript and want to assign that to a custom capability, I explored a lot but unfortunately none of them worked, any help will be appriciated. My codes are as below: add_action('...
0
votes
1answer
23 views

How to write conditions based on user capabilities not on user role?

How to write conditions on capabilities not on user role?
0
votes
3answers
31 views

Hide custom post type by user roles

I created a custom post type ( Customers ) and i want to show posts of this post type just to the users with Customer role. there is any way without or with plugin?
0
votes
0answers
23 views

Disable update for custom post type

I have a custom post type and all posts of this kind is created during a scheduled event which fetched all data from an external API. So far so good, the problem now is that I would like to prevent ...
0
votes
1answer
40 views

Recent posts on homepage: different thumbnail based on logged in status and post category

This works well on archive.php, but not working on the homepage. For some reason, the first statement doesn't get applied: if a post is in Members category and user is not logged in, it's supposed to ...
0
votes
0answers
20 views

See which user role / capability is needed to use a plugin

I have installed a plugin (https://de.wordpress.org/plugins/food-and-drink-menu/) for which I want to assign permissions to a normal "editor" user. I found the plugin "User Role Editor&...
1
vote
1answer
23 views

Logout users upon login, based on caps/role?

To reduce spam registrations, users are assigned the pending role until they're vetted (at which point they're assigned the subscriber role). The pending role has no capabilities. When pending users ...
0
votes
0answers
11 views

Custom Post Type Capabilities - delete_published not working

For some reason, the 'delete_plublished_articles' capability on my custom post type doesn't work. I'm removing this capability from the administrator role, but I'm yet able to delete published posts. ...
0
votes
0answers
14 views

Update a custom role with new capabilities

I have created a custom user role for a site where the role can do almost anything an administrator can do minus a few capabilities like: -Update, Delete, Upload plugins -Change, Delete, Upload Themes,...
0
votes
1answer
16 views

Hide front-end from every logged out user and redirect them to the default login page

I want to hide the front-end from every visitor/logged out user. To see the front-end, every user must have been registered and logged in. Any visitor that's logged out should be redirected to the ...
1
vote
0answers
7 views

Admin access for custom user capabilities

I've got a site with a lot of custom user roles and capabilities, and I'm trying to allow users with a new capability 'admin_panel_access` (set up via User Role Editor) to access the admin dashboard. ...
0
votes
0answers
20 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
1answer
16 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
37 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
19 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
25 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
39 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
79 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
35 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
10 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
16 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
18 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
52 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
18 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
41 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
16 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
9 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
41 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
13 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
9 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
25 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
25 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
12 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 ...

1
2 3 4 5
27