Change WordPress user roles and capabilities Forums Give user access to plugin – how to Limit author-level users access to specific post categories

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3763
    officezen
    Participant

    I just purchased the pro version.

    Where do I go to set up this globally for all author-level users?

    #3764
    Vladimir
    Keymaster

    In 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.

    #3765
    officezen
    Participant

    Thanks 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?

    #3766
    officezen
    Participant

    Also, 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.

    #3767
    Vladimir
    Keymaster

    Unfortunately, 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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.