Forum Replies Created
-
AuthorPosts
-
03/08/2016 at 01:56 in reply to: Why URE restricted role when it is clearly given permission (on Submenu)? #2608James WeeParticipant
Dear Vladimir,
The Custom Posts Types were handled by CPT UI. If you’re looking for the respective post’s capabilities, they are:
Capability Types
news
events01/08/2016 at 02:51 in reply to: Why URE restricted role when it is clearly given permission (on Submenu)? #2597James WeeParticipantDo test it out and share back your findings. If you want my code please let me know 🙂
29/07/2016 at 05:03 in reply to: Why URE restricted role when it is clearly given permission (on Submenu)? #2591James WeeParticipantYes, but I have granted all privilege (including create_{posttype} ) for the post type “news” and “events”.
And with this submenu setup alone it will not allow me to create news and events.
$submenu_pages = array( array( 'parent_slug' => 'edit.php?post_type=news', 'page_title' => 'All News', 'menu_title' => 'All News', 'capability' => 'edit_newss', 'menu_slug' => 'edit.php?post_type=news', 'function' => null,// Uses the same callback function as parent menu. ), array( 'parent_slug' => 'edit.php?post_type=news', 'page_title' => 'All Events', 'menu_title' => 'All Events', 'capability' => 'edit_eventss', 'menu_slug' => 'edit.php?post_type=events', 'function' => null,// Uses the same callback function as parent menu. ), )
I have to do something like this in order to enable create_{posttype} for the users. Why is that so?
$submenu_pages = array( //edit.php array( 'parent_slug' => 'edit.php?post_type=news', 'page_title' => 'All News', 'menu_title' => 'All News', 'capability' => 'edit_newss', 'menu_slug' => 'edit.php?post_type=news', 'function' => null,// Uses the same callback function as parent menu. ), array( 'parent_slug' => 'edit.php?post_type=news', 'page_title' => 'All Events', 'menu_title' => 'All Events', 'capability' => 'edit_eventss', 'menu_slug' => 'edit.php?post_type=events', 'function' => null,// Uses the same callback function as parent menu. ), //post-new.php HIDDEN array( 'parent_slug' => 'null', //Don't display on menu 'page_title' => 'Add News', 'menu_title' => 'Add News', 'capability' => 'create_newss', 'menu_slug' => 'post-new.php?post_type=news', 'function' => null,// Uses the same callback function as parent menu. ), array( 'parent_slug' => 'null', //Don't display on menu 'page_title' => 'Add Events', 'menu_title' => 'Add Events', 'capability' => 'create_eventss', 'menu_slug' => 'post-new.php?post_type=events', 'function' => null,// Uses the same callback function as parent menu. ), )
28/07/2016 at 06:06 in reply to: Why URE restricted role when it is clearly given permission (on Submenu)? #2586James WeeParticipantOh damn, I did! I set the “Capability Type” in CPTUI with camelcase. Changing it now.
BTW. Is it a WordPress requirement for have both the capabilities below in order for View and Create to work?
edit_posttypename (edit.php)
create_posttypename (post-new.php)Because I just created a new submenu called Programmes with Foundation, Diploma, Degree, Postgrad and it just kinda bugs me to create 4 edit.php and hide 4 post-new.php
28/07/2016 at 02:28 in reply to: Why URE restricted role when it is clearly given permission (on Submenu)? #2584James WeeParticipantYes, it’s a typo on my part. Role Editor Plugin automatically adds an “s” to the back of all capabilities. (LOL)
1. To rephrase, the custom post type capabilities are
– create_Newss, edit_Newss and all other prefixes (delete, publish, read)
– create_Eventss, edit_Eventss and all other prefixes (delete, publish, read)2. Nope, Admin Menu Access is not activated.
I have sort of created my outcome by doing the following code below (setting “parent_slug” to null).
This hides the “Add News” and “Add Events” buttons while giving the user the capability to create_Newss and create_Eventss. I don’t understand why, but if I don’t add the 2 buttons below, the user does not have permission to do create_Newss and create_Eventss.array( 'parent_slug' => 'null', //Don't display on menu 'page_title' => 'Add News', 'menu_title' => 'Add News', 'capability' => 'create_Newss', 'menu_slug' => 'post-new.php?post_type=news', 'function' => null,// Uses the same callback function as parent menu. ), array( 'parent_slug' => 'null', //Don't display on menu 'page_title' => 'Add Events', 'menu_title' => 'Add Events', 'capability' => 'create_Eventss', 'menu_slug' => 'post-new.php?post_type=events', 'function' => null,// Uses the same callback function as parent menu. ),
19/07/2016 at 02:17 in reply to: Give User Full Access to "Page" but restrict Post ID in "Post Type" #2562James WeeParticipantOkay, let’s rephrase everything again.
I have 2 post types
1. Pages
2. Community (Custom Post Type)I’ve given full access (create delete edit publish read) on both post types. So the user can create and edit everything within the 2 post types listed above.
But I only wanted the user to be able to edit post 1601 only in “Community” but everything else in “Pages”.
So I went ahead and added “1601” in “Posts/Pages/Custom Post Types Editor Restrictions”
with post ID (comma separated) : 1601 and press “Update User”.Now the user cannot see all posts in “Pages” and “Community” except post 1601 in “Community”. It’s like the URE is overwriting the Role Editor global settings when it is supposed to compliment it.
Ideally when I set with post ID (comma separated) : 1601. I should:
1. Page: Still be able to create and edit all posts – according to global role editor settings
2. Community: Can only see post 1601 and cannot see all other posts.James WeeParticipantGood stuff. Look forward to the updates.
James WeeParticipantThanks for being very open about this.
I actually like how the member plugin did it in a very organized and tabled way.
Have a look here.
https://s.w.org/plugins/members/screenshot-2.png?r=1393548The only request I want improved on top of their work is the use of “shift” key to multi-select many checkboxes, like how you can use the shift key to select checkboxes on Gmail.
-
AuthorPosts