Questions tagged [user-roles]

Names for a set of user capabilities.

Filter by
Sorted by
Tagged with
1
vote
1answer
51 views

Getting users by specific capability, not role

Is there a way to use the get_users() function, or maybe another way, to retrieve all users of a custom user capability? For example, I have given a select number of users the capability of '...
0
votes
0answers
48 views

Add custom parameter for custom user role

I added a new user role by add_role() function via my plugin's activation function. I would like to add an integer parameter to such custom role, for example, score parameter which the default value ...
0
votes
1answer
22 views

show the author's role along with the name in the single.php

some way to show the author's role in wordpress for example: Administrator, editor, author, contributor ect... Let something like this be left: This post was written by contributor JUan I'm just ...
0
votes
0answers
11 views

How to relate Two Different Users from Two Different Roles in Wordpress

How can we relate two users in wordpress that are from two different roles. For example: I have created two roles; Role1: Manager Role2: Sales Users in Manager: Manager will be having multiple ...
1
vote
1answer
30 views

Page template that redirects user based on role

I'm trying to come up with a wordpress page template (acting as a landing page) that redirects a user to another page based on their role. ex. user with role editor goes to landing page and is ...
0
votes
1answer
35 views

How to change user role after login?

I am working on a wholesale site and want the site to automatically change the user role from customer to wholesale customer after login. This will allow the wholesale customers to see wholesale ...
1
vote
1answer
25 views

Enabling users to upload files

I have a page template, where users can upload images. I use this piece of code for opening modal for media (js; only part of a code): image_frame = wp.media({ title: 'Select Media', multiple : '...
0
votes
0answers
14 views

Getting total string value in wp_capabilities and also not able to see role in wp-admin

I've created a new role named adivaha_partner and when registering it with the new role I am using update_user_meta and add_user_meta for inserting and updating in meta table. All things are working ...
0
votes
0answers
18 views

User Role always is subscriber after adding User with custom Role

following this: How to allow an user role to create a new user under a role which lower than his level only? i can now create new users with my custom role, that can only have the custom role i ...
0
votes
0answers
18 views

Get count of posts by authors with Editor role between dates

I'm trying to find a query that can give me the count of posts made during 2019, but only if the author is an editor (I don't want posts by subscribers). I would like to also show the count by author'...
0
votes
0answers
19 views

Adding user using admin ajax by a user with custom role

I have a form in which user A with a custom role is able to invite other users. Javascript which handles that looks like this: sendNotificationEmail(newUserId) { newUserId = parseInt(newUserId)...
1
vote
2answers
33 views

What are some best practices for user exit strategy?

We have a key employee who is resigning. I would prefer to retain her attribution for stories she has posted for our institution. My first thought was to create a custom "resigned" user role and move ...
1
vote
1answer
18 views

Assign a role to the user who registers on a form

I created a registration form where I integrate Stripe for payment. Everything works correctly and I was also able to create the wp_users and wp_usermeta table in the database. The only thing I can'...
0
votes
1answer
23 views

Want to know parameters that can be passed to user_can() for access control by user capabilities

I noticed someone else posted the use of user_can() in controlling access permission which appears very useful for an EC site: How to use current_user_can()? As I want to delicately control access ...
0
votes
1answer
24 views

Fix 'Add Role' Option not there in wordpress 5.2.2

I am making my website on the net and practicing it on localhost wordpress. I want to add a new role in my wordpress, but in both my sites(localhost and internet) I can't find the option to add a role....
0
votes
0answers
10 views

How to Moderate Edits to User Profiles?

I would like to moderate WordPress users’ edits to their own profiles. As I understand it, the default would be for the profile changes to go online immediately. Instead, I’d like to leave the older ...
0
votes
0answers
23 views

Wordpress download of custom CSV file blank

I have a Javascript download function that provides the download of a CSV file from a custom table of a specific page that is private. The function works perfectly, if the user is logged as an Admin,...
0
votes
0answers
35 views

Why is unfiltered_upload not working despite being enabled?

According to the Codex, all that's needed to enable the unfiltered_ upload capability - i.e. the ability to upload any filetypes to the Media Library rather than just the default whitelisted ones - is ...
0
votes
1answer
54 views

WordPress - Limit custom/specific user role to only have access to edit the contents of an Advanced Custom Fields Pro Options Page

I've tried a few role plugins already: Members, User Role Editor, User Role Field Setting for Advanced Custom Fields Pro (this doesn't apply to an options page--just ACF fields on their own), ...
0
votes
0answers
13 views

Add new user role and allow only edit “Tags” of posts

I would like to add a new Wordpress role and assign to it the permission to only edit Tags of Posts. How can I do it? PHP code or Plugins are welcomed. Thanks.
0
votes
1answer
33 views

How to show only specific category post by user role without plugin and restrict all other cats

I am using basic post for adding posts. 5 categories exist ( cat_A, cat_B, cat_C, cat_D, cat_E). And I have 2 custom user_role for registered visitors that is 'viewer_a' and 'viewer_b'. I need to show ...
1
vote
1answer
15 views

How to allow an editor to edit all WordPress blog posts but have the last say as administrator?

I run a simple WordPress setup hosted on SiteGround with no staging area and no special roles. The blog grew so much over the last few years that I barely write any content anymore. I send a content ...
0
votes
0answers
18 views

Grant access to plugin settings to editor role? Unbounce Landing Pages Plugin

I'm trying to allow an user with the editor role on my site the ability to access the dashboard settings for the Unbounce Landing Pages plugin. Here is the code that controls the settings tab pulled ...
0
votes
2answers
21 views

Used a code to revoke some dashboard menus for my contributors but for some reason it's revoked me access to the editor [closed]

I was hoping to limit the access that my new team of contributors have through the dashboard; and stumbling this video on YouTube on how to possibly limit this; i thought i'd give it a shot. Here's ...
0
votes
0answers
15 views

How to make this custom capability work? [duplicate]

I am trying to make a custom ability on my page CV people can insert and then view their CV I made a custom capability view_cv and I want for it to remove the option to view their CV. <a class="...
0
votes
1answer
22 views

How to restrict category creation to admins only while allowing editors to still pick category

Is there a hook which would enable an admin to disallow editors and authors from creating new categories for posts? Only admins should be able to create new categories. Editors & authors need to ...
0
votes
1answer
51 views

TCPDF only exports .pdf when user is administrator

Context I use TCPDF for PDF generation hooked to admin-post. The admin-post-action handling function retrieves an object from database according to query parameters, requires a template.php and ...
0
votes
1answer
35 views

How to create different views for different user roles?

I am creating a website where highschoolers can go do a bunch of tests to see what are their best abilities, what work would suit them etc. The tests work. I have created a registration form whit ...
0
votes
0answers
25 views

Import single site into multisite

I am puzzled. I am importing a single site into a WordPress multisite. I have followed all proper steps which are explained on various sites. There are several, but I used these 3: https://code....
0
votes
0answers
10 views

Redirect a user roll to a page after login in mutlisite network

Trying to redirect a custom user role to a page after login on a specific blog in a multisite network, from what I checked, the isset( $user->roles ) does not pass /** * Redirect users to page after ...
1
vote
2answers
40 views

Prevent custom user role to add new pages

How can I prevent my custom user role to not be able to add new pages. I have this array of capabilities for my user role: $args = array( 'delete_others_pages' => false, '...
0
votes
0answers
15 views

Create a custom role to can access only a custom api endpoint to fetch data

I have a small external app which is communicating with a wordpress custom REST API endpoint, in the meaning is requesting some data aggregation from web but will never push back data to wordpress DB. ...
0
votes
0answers
9 views

Assign specific role to a specific registration page

I have a page that I want to direct traffic to in order for them to register on the website, however, I want these users to have a different user role than the normal "subscriber" role so I created ...
1
vote
1answer
56 views

Allow users to publish child pages of the pages they have access to edit

I have created a custom role called Custom Author. Users in this role can edit their own pages and add new pages. I would like to restrict new page creation and allow Custom Authors to create pages ...
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
154 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 ...
-1
votes
1answer
27 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
29 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
147 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
56 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
36 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
23 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
20 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
30 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
15 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
96 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
36 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?

1 2 3 4 5 24