Questions tagged [user-roles]

Names for a set of user capabilities.

Filter by
Sorted by
Tagged with
1
vote
0answers
16 views

Stop users posting into category while still seeing contents of the category

I have been hunting this for days without success. I have many categories which users are free to post articles into, but there is one category I want to restrict to a specific role. My Wordpress ...
0
votes
0answers
17 views

Disable Wp-Admin For Non Admins By Default, How?

On one of my website, new users (default: subscriber type) cannot access (shows an error) wp admin nor see wp admin bar as default without any plugin or functions.php. But on my other website, new ...
0
votes
0answers
8 views

Restrict uploads content view only admin user

I have created new website and users are uploaded their documents into wp-uploads/documents/user_name folder. The file path will show like this https://example/wp-content/uploads/documents/example/MP-...
0
votes
1answer
13 views

Set correct player role on signup with multiple plugin roles involved? [closed]

I have a wordpress website with the plugins s2member and sportspress. When a user pays using the s2member stripe form, upon account creation it automatically sets the role as "s2 member level 1." This ...
0
votes
0answers
13 views

How to disable plugin capability : “create new category”

I tested that a capability can be disabled for any user role, but I found nothing to block the capability of a plugin. Is this possible? any help is greatly appreciated
0
votes
1answer
23 views

allow non logged in user to upload images in media library

I have a website where I have a page that is accessible from any non logged in user . Its a form where I need to upload image through the form but when I try this its showing an error. But When I ...
0
votes
0answers
8 views

User role conflicts

Thanks for reviewing, I am setting up a site for a client with 2 plugins for users to post classifieds. I was not able to locate 1 plugin to list the content the way the customer wants so I installed ...
1
vote
1answer
18 views

Prevent third party plugin's admin page access based on user type

Am using a third party plugin(eg. ABC Plugin). And their code doesn't have any hooks or filters. And they don't provide customization based on our requirements. So if I modify the plugin code, I ...
0
votes
1answer
14 views

How to hide user profile fields based on the role of the viewed user?

I want to hide some default fields of the backend user profile page based on the role of the user whose profile is being viewed (by the admin in this case). I used the simple CSS way to achieve that (...
0
votes
1answer
20 views

User capability for editing their own comments

I'd like to allow certain (logged in) users to be able to edit their comments. I don't care if they can only edit through the back-end - obviously front-end editing would be lovely, but I'm willing to ...
1
vote
0answers
15 views

I want to create custom post in which user can share files like PDF & DOCx

I want to create custom post type for users in which user who is login can share files by selecting categories like below form..
3
votes
2answers
28 views

How to assign user a role if none is present when logging in

I currently have a front end part of a WP site that allows admins to create new users and assign then user roles from a drop down - that works perfectly. However, I am using a plugin to also ...
0
votes
0answers
22 views

Quiz time! Is there a way to restrict an editor's editing permissions so they can only edit posts by specific contributors?

We're spinning up a new team of writers, with a new editor. I want the new editor to be able to edit posts created by the new team. But I don't want the editor to be able to edit existing posts, or ...
0
votes
1answer
15 views

Create role that can edit some user details, but not the role

I want to create custom role ('sales') that can edit user profiles of 'subscribers' but can not change the role of that user. The user details that would be editable by the 'sales' role would be ...
1
vote
1answer
48 views

How to allow user to edit post in wordpress

I want to allow users to edit the posts without giving the admin access. I have a Basic Authentication plugin which stopping them to access it. But when i deactivate it they're able to edit the posts ...
1
vote
1answer
23 views

Change color of audio player depending on user role

I've changed the color of the Wordpress audio player using this CSS code. /* change colours of audio player */ .mejs-controls, .mejs-mediaelement, .mejs-container { background: url('') !...
1
vote
0answers
76 views

Limit users by custom taxonomy and user roles

This is not duplicated post! I working on the custom theme and have 2 taxonomies: bezirk and ortsgruppen. bezirk acts like main group and ortsgruppen is the sub group under bezirk. I need to asign ...
2
votes
1answer
24 views

SQL User Query by Multiple Roles using PHP

I can successfully get all my WordPress users using the following code: global $wpdb; $sql = 'SELECT * FROM ' . $wpdb->users; $users = $wpdb->get_results( $sql, 'ARRAY_A' ); However, I need to ...
0
votes
0answers
17 views

What would cause wp_insert_user role to work sporadically?

I use the following code in a frontend form. About 10% of the time, the new user is created as a 'subscriber'. What would cause this erratic behavior? $new_user_id = wp_insert_user(array( 'role' =&...
0
votes
0answers
17 views

How can I add capability to multiple roles?

I have this variable: $wpll_accesslist = self::$options['wpll_settings']['wpll_accesslist']; and it's output is: Array ( [Author] => 1 [Contributor] => 1 [Shop_Manager] => 1 ...
0
votes
1answer
27 views

assign roles to users in custom drop down in signup form

I have made html signup form, in that i have added users role drop-down, while filling up signup form when i am selecting value from users role drop-down, its not getting updated in wp_usermeta table ...
0
votes
0answers
44 views

searching for posts, with user meta parameters

I try to show posts for all registered users. The users have some user_meta fields, that i can display suggested posts for them. I have exact the same function in use on the profile page of a user, ...
0
votes
0answers
31 views

Meta query orderby meta_value_num sorting by role first

I want all of the results to order by meta_value_num, but it's ordering by role first. How do I get them to ignore the role order? Here's my code: $user_query = new WP_User_Query( array( '...
0
votes
0answers
6 views

Multi-level user group and role in Wordpress to create personal posts/contents?

I don't want to use any plugin to do this and write the functionality on my own. The client asked me to create a system with WP where a user as admin role (similar to CEO for example) will open ...
0
votes
1answer
16 views

Allow a page to be edited by a specific custom role

I have created multiple custom roles using the members plugin by Justin Tadlock. Now i want certain pages to only be editable by the custom roles i select for them. Is there a plugin i can use for ...
1
vote
1answer
46 views

Error shown for Trying to get property 'roles' of non-object in Wordpress After Content for User Roles

I have been struggling to code a function, which echoes a code, when the user role is 'administrator' or is um_verified' Honestly I don't know much of what it means, but still, I want to solve this ...
0
votes
1answer
36 views

Hide Users by user role in Worpress

I'm trying to only show authors in my user's page. I was hoping that user role editor could do the trick but apparently not. Is there a way to do it? Thanks
0
votes
1answer
23 views

Allowing custom role user to edit post assigned to them but don't let them create new custom type post

Please don't mark this as already asked question as I have searched all the questions and none of them gives a clear answer. So I have created a custom role through Members plugin and I want the user ...
0
votes
1answer
25 views

WordPress custom post type capabilities issue

Using WP 5.2.4, I am registering my custom post type with this code: $args = array( 'labels' => $labels, 'public' => false, 'show_ui' => true, '...
0
votes
0answers
18 views

User role templates

I'm currently using the author.php template to display a frontend archive of users' posts from all roles. I've now created a new user role ("trainer") that needs to have a completely different ...
0
votes
0answers
12 views

I need to forbid or deny a custom administrator role from creating other administrator user role

What can I add to this code? ... I need to forbid or deny this custom administrator role from creating other administrator user role? thank you add_action('init', 'cloneRole'); function cloneRole() {...
0
votes
1answer
17 views

Hook into add_user_role and update based on new and removed roles

I need to add user meta based on each role added and removed. I tried to achieve this by hooking into add_user_role and looping through and updated list of user roles but the old ones are still ...
1
vote
1answer
41 views

Hide from specific role the top admin bar new button

How can I hide at the top admin bar the "new button" which is a shortcut to publish new posts, new pages etc. I will hide from a specific role, but being new to WordPress, I am looking for the ...
1
vote
1answer
25 views

Allow administrators to pick post author on custom post type edit screen

I need to be able to allow Administrators to choose a different author for a post they create or edit in admin. I've added the post author capability, and the select field displays on the edit screen,...
0
votes
1answer
28 views

Restrict user to only one custom post type

I am new to wordpress, i create a custom post type called news and i need to restrict access to one user, to only this custom post type. I am using wordpress 5.3, i do install the advanced custom ...
1
vote
1answer
42 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
19 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
29 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
33 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
23 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
12 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
16 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
17 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
17 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
20 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
23 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....