Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › Limit author-level users access to specific post categories
- This topic has 4 replies, 2 voices, and was last updated 8 years, 5 months ago by
Vladimir.
-
AuthorPosts
-
19/05/2017 at 18:41 #3763
officezen
ParticipantI just purchased the pro version.
Where do I go to set up this globally for all author-level users?
20/05/2017 at 01:45 #3764Vladimir
KeymasterIn order to restrict authors to post only to the selected list of categories use posts/pages edit restrictions add-on:
– activate add-on at Settings->User Role Editor->Additional Modules;
– go to Users->User Role Editor;
– select ‘Author’ role;
– grant ‘create_posts’ capability to this role;
– click ‘Posts Edit’;
– select “Block” or “Allow” action;
– input a list of digital category IDs to which you wish to block or allow access;
– save your changes.20/05/2017 at 02:45 #3765officezen
ParticipantThanks for the detailed instructions.
One issue I’m facing now:
For post categories, I can block the users by adding only allowed CPT IDs with Allow – this will display only allowed categories pre-selected when they try to add a new post.
For Business Directory which has 20 categories, I do not wish any of them pre-selected. If I add their IDs to Allow, the very fist Business Directory category is pre-selected, which I do not want.
Is there way to achieve these two at the same time?
20/05/2017 at 02:49 #3766officezen
ParticipantAlso, I tried using “Prohibit” instead blocking all the unauthorized categories. This works with the Business Directory categories, displaying them all with no pre-selected category, but when you go to add post for the authorized category, the category is not pre-selected, which I preferred selected.
20/05/2017 at 02:53 #3767Vladimir
KeymasterUnfortunately, No.
Look, when user clicks ‘Add New’ post, WordPress creates a new post record at the database and then re-open for editing the existing (just new added) post. As you allowed to user to edit posts from selected categories list only, if this new added post will not has any allowed category, WordPress will show “You don’t have permissions to edit this post”. This is a reason why I have to assign automatically to the new added post the 1st item from the allowed list of available (allowed) categories.
So user has to reselect needed category if needed after that.
-
AuthorPosts
- You must be logged in to reply to this topic.