Skip to main content

Questions tagged [user-roles]

Names for a set of user capabilities.

Filter by
Sorted by
Tagged with
2 votes
1 answer
2k views

Shold I manually add 'cap' to admin role ?

I've created a role: $role = add_role( 'role', 'role', array('read' => true) ); and so created a cap: $role->add_cap( 'cap' ); after this I'd created a submenu in admin menu with 'cap' as ...
Victor Aurélio's user avatar
2 votes
1 answer
2k views

Change the user role after x days

Is there a way to change back the user role after x days? When people register at my site, they have an 2 options to choose: seller or customer. I want to put an additional user role member1, and if I ...
user avatar
2 votes
1 answer
1k views

How to make an author archive only for certain user role and show related CPT

Scenario I made a CPT where I'm taking the stakeholder's ID as a custom field. All the stakeholders are actually a WordPress' Registered User with a different role stakeholders - because at some point ...
Mayeenul Islam's user avatar
2 votes
1 answer
551 views

Make certain pages uneditable by editors?

My Wordpress page has a few editors. They need this permission because they need to be allowed to change the posts/pages of others. However there two pages I want only me, the administrator to be able ...
Hedge's user avatar
  • 133
2 votes
3 answers
26k views

Displaying which Role the current user is assigned to

Is there a section on the admin panel of my WordPress installation which just displays what role the current logged in user has? For example, I know I have administrator permissions because I know ...
mikelovelyuk's user avatar
2 votes
1 answer
6k views

Woocommerce: change user role after completing order

:) I'm using wordpress with woocommerce, and I would like to automate the following step. When an order is completed, I would like to change the user role associated with that order id from 'customer'...
Rostam's user avatar
  • 23
2 votes
2 answers
1k views

Getting a user role from the user login name

The question might be simple. Since I need to fix it soon I had to ask. Currently I am modifying a free plugin. In that I am having the user login string. How can I get the role for that login? I'...
Kannan Ramamoorthy's user avatar
2 votes
1 answer
3k views

Add a drop down list to comment form?

Can somebody help me to create a drop-down menu or (radio buttons) in Wordpress comment form, so that a new user could make a selection of their user roles (for example teachers + students) ? Output ...
Daniel Foltynek's user avatar
2 votes
1 answer
402 views

How-to Delay The Capability To Publish Posts?

I use buddypress and all new members have the role of author. The site is more like a forum with one topic. I'm not worried about comments, just posts. Recently I have received a bunch of spam from ...
john powell's user avatar
2 votes
1 answer
249 views

How can I let users to access plugin functions based on roles?

I use a plugin called "Live Edit" to let authors and editors edit the content front-end. But the issue is that the plugin lets any logged in users to edit the content. I want the edit(specified by ...
Netizen's user avatar
  • 179
2 votes
2 answers
7k views

How do I redirect upon login a specific user based on role?

I'd like to force a user to a specific page upon login based on their role using if ( current_user_can('contributor') ) and the main login function function wp_loginout($redirect = '', $echo = true)...
Zach Shallbetter's user avatar
1 vote
1 answer
827 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 ...
Anna's user avatar
  • 13
1 vote
1 answer
216 views

disable adding new tags on the edit and add post

I use the admin menu editor plugin. I have not allowed editors and authors to access the tags section But they can add a new tag in the post edit section This is not good for our site We want them to ...
Ali Kiani's user avatar
1 vote
1 answer
622 views

Show different badge based upon the user role

Problem I have authors page and I need to display a different badge for Authors and Subscribers. Authors on the site have certain abilities that differ from Subscribers and I would like to display a ...
jimilesku's user avatar
  • 263
1 vote
1 answer
3k views

pre_get_posts Remove posts based on meta value with 'post__not_in'

I am attempting to alter the query of pages where the post meta value of _members_access_role does not meet that of the currently logged-in user. Here is what I have so far: // Get all posts with the ...
Zach's user avatar
  • 1,923
1 vote
1 answer
2k views

How to restrict specific post types from being read or added by specific user roles (eg. author)?

I'm not very clear how to restrict admin area post types access to specific user roles. In my case, I have some post type such as "suppliers" which I do not want to show to "authors". By default WP ...
unfulvio's user avatar
  • 1,814
1 vote
1 answer
648 views

Prevent Contributor to show comment list

How can I change WP so the Contributors will not show to comment for other post, So they will see only the comments to their post?
user186585's user avatar
1 vote
3 answers
4k views

Expanding the allowed HTML tags in comments?

I have no problem doing this in a comment, as an administrator: <b>bold test</b> <i>italics test</i> <u>underline test</u> <font color="#ff9900"> color test&...
wyc's user avatar
  • 3,867
1 vote
4 answers
6k views

WordPress edit_user_profile_update update secondary role

I am trying to save secondary role field in user-edit.php which is independent of WP's main roles. I had no problem with saving other custom fields that are unique but for roles (wp_capabilities), it ...
Nikola R.'s user avatar
  • 165
1 vote
1 answer
417 views

How to reload the role specific registration form on validation errors?

I test a solution for separate registration for different roles and it works very well. But the validation part/function (see bellow) on errors reloads/reuses the generic registration link and not the ...
Yuri's user avatar
  • 1,121
1 vote
1 answer
519 views

Specific post user permissions

in that gives a specific user the option Edit a specific post I searched and found only plug-in that give the user the option to edit all posts But I did not see anything reference to a specific ...
eden's user avatar
  • 11
1 vote
1 answer
591 views

Enable comments for post with comments meta box removed

I have created a custom post type in a plugin for a site I'm working on. I'm allowing users assigned a custom role to add/edit/delete the custom post type. I would like to give these users as little ...
Dave Konopka's user avatar
1 vote
0 answers
648 views

Adding multiple user roles dynamically [closed]

We are using this plugin Members to give users multiple roles on our site, in this case we have "Vendor" and "Instructor". After submitting a Gravity form to become a 'Vendor' I have added this code ...
Benjamin's user avatar
  • 185
0 votes
1 answer
344 views

How do I code access to the built-in UI of a CPT when it's placed as submenu of another CPT that is protected by role?

I am toying around with WordPress capabilities, and having some difficulty understanding where I am going wrong. Right now, I have an admin menu that appears for all administrators with STUDENTS as a ...
Bernie's user avatar
  • 1
0 votes
1 answer
4k views

Issue with front-end ajax, getting a 302 redirect when accessing wp-admin/admin-ajax.php

I want to use wp ajax for frontend logged in user but showing error of 302 Found and call home page. it is working fine for admin users and non logged in users. here is network log screenshot: i ...
Gauravbhai Daxini's user avatar
0 votes
2 answers
1k views

Allow a user or role to view drafts and previews, but not other admin privileges?

How do I allow a specific user or a specific role to view drafts and previews, but not allow them to edit posts or have any other admin capabilities? I can add a custom capability to a role, but don't ...
Michael's user avatar
  • 281
0 votes
1 answer
152 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 ...
sofarocker's user avatar
0 votes
2 answers
938 views

Allow contributor to view own scheduled post

As an admin, I can preview scheduled posts. In the post listing, there's a "preview" link which appears if you hover over the scheduled post title. As a contributor, I can preview a post if it is in ...
Horakiri Suo's user avatar
0 votes
1 answer
2k 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 ...
nickpish's user avatar
  • 217
0 votes
1 answer
124 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 "...
Lucas Catani's user avatar
0 votes
4 answers
5k views

Dynamic homepage according to user role

I have develop a wordpress website consulting and I have different user role and I want to have different content according to user role so I have a landing page with authentification and ...
ouanounou's user avatar
0 votes
1 answer
264 views

How to add author role as a custom field to custom post type in wordpress?

I want to add a custom field in the wordpress custom post type, such that this field dynamically fetches the value of the author role. Purpose - I want to add this custom field so that I can filter ...
Malani's user avatar
  • 21
0 votes
0 answers
32 views

WordPress Multisite Layered Admins

I'm using WordPress multisite for a company project. The project have 5 multilevel admin structure with about 100 websites. The top level (5) admin (super admin) have access to all the sites. The ...
ken4ward's user avatar
  • 111
0 votes
2 answers
7k views

Custom Post Type's Capabilities map_meta_cap issues

I've created a CPT, added capabilities to it and them to the Subscriber role successfully. However the mapping is clearly not working because I get errors on publish and a Subscriber cannot edit ...
Ben Racicot's user avatar
  • 1,416
0 votes
1 answer
506 views

Reapproval for edits and deletion after post is published

I regularly have guest authors who post one or more articles on a non specific schedule. So I provide them with permanent contributor accounts to avoid the hassle of making them accounts and deleting ...
Danny's user avatar
  • 249
0 votes
1 answer
2k views

Remove Posts Quick Edit link for specific user role? WP 3.3

I am using Wordpress 3.3.2 with the following plugin: - http://wordpress.org/extend/plugins/advanced-access-manager/ The plugin works perfectly but the author said there is currently no way to ...
Damainman's user avatar
  • 253
0 votes
1 answer
3k views

Why is wp-login redirecting to the home page when I use this function?

I'm perplexed; I can't see where I'm going wrong with this code. It should redirect any subscriber-level users back to the site home page if they try to access anything within /wp-admin - but not if ...
Michelle's user avatar
  • 3,448
0 votes
1 answer
407 views

Remove Adminstrator Hyperlink from a user having role to add and see users

I have create a user role using Advance Access Manager wordpress plugin having role to see, add and remove users name as site_admin. When user login with his Id he is able to see the adminstrator and ...
ksr89's user avatar
  • 584
0 votes
2 answers
392 views

Adding capabilities to default roles

I created a custom post type and gave it the following capabilities: add_action( 'init', 'create_team_page_post_type' ); function create_team_page_post_type() { $args = array( 'labels' => ...
mantis's user avatar
  • 790
0 votes
1 answer
961 views

Allow Content Author to Publish, But Not Edit or Delete

I am hiring a content writer for my WordPress blog. I will be the sole blog admin. I need to define a role for this writer. I was wondering if there was a WordPress user role that will allow him to ...
Dzhuneyt's user avatar
  • 152
0 votes
1 answer
1k views

How can I get the last posts by user role?

I have a custom post type ("News"), and a custum user role ("Friends"). How can I get the last "News" written by "Friends" ?
mike23's user avatar
  • 5,981
0 votes
1 answer
923 views

How to order posts by custom WP role?

I currently have the following custom wp_query which displays posts from 2 custom WP roles, "custom_role_one" and "custom_role_two". It displays the posts from my custom post type of "listing". It ...
Andrew's user avatar
  • 1,163
0 votes
1 answer
2k views

Hide posts from users with a specific role

Simply put, I need to hide all posts on the frontend if they are written by authors with a specific role. The role I have created is called 'Suspended'. I'm happy with putting a simple IF statement ...
Adam Moss's user avatar
  • 1,052
0 votes
5 answers
4k views

Hide menu items for visitors and filter based on role

In my menu i've got some menu items that i don't want to show to people who aren't logged in. One of these i only want to show to logged in users of a certain roles the other to everyone logged in. ...
Corbula's user avatar
  • 169
0 votes
3 answers
8k views

I need to assign a role to visitors/guests

Is there a way to create a 'role' in WordPress for a guest? I am using a role visibility plugin which lets me choose the type of visibility to each role. However a Guest hasn't got a role. I can ...
emma's user avatar
  • 1
0 votes
2 answers
848 views

Include Author profile in search results

I need to add user profile to search results for a site we look after. I need to return any user with role of 'Consultant' (and only consultant) whos name or nickname or whatever matches the search ...
John Halsey's user avatar
0 votes
1 answer
2k views

Is there a way to set the user Role based on email domain

For example if a user registered with the email domain: [email protected] They will be set as a contributer. but if any other email such as [email protected] they will be set as a subscriber? ...
jackdh's user avatar
  • 115
0 votes
1 answer
135 views

Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end

Restrict backend. add_action( 'init', 'blockusers_init' ); function blockusers_init() { if ( is_admin() && ! current_user_can( 'administrator' ) && !( defined( 'DOING_AJAX' ) &...
Ohsik's user avatar
  • 407
0 votes
1 answer
183 views

Which User Role for Custom Post Type Menu - wp_nav

I have a site with a custom post type "Streams". I would like for my editor to be able to add steam post types to the main menu of the site, but he cannot see them under Appearance->Menus. Which ...
elke_wtf's user avatar
  • 383
0 votes
2 answers
3k views

Removing or Restricting Access to Page Templates for Editor Role

I have a question about restricting access to page templates for blog editors who may create new pages in the future. During my buildout, I had to create specific templates to add custom features for ...
unwrittendevin's user avatar