Support

Account

Home Forums Backend Issues (wp-admin) New user role – limit which option pages the user can see

Helping

New user role – limit which option pages the user can see

  • Hello,
    I need to create a new user role for my project.

    I have a lot of options page (about 30). This new user role should not be able to see every option page in the menu.

    What is the best way to implement this?

    Is there a way that I can say in add_role(). I generally don’t want to show ACF option pages for now (for this user role), only the following option pages should be shown. When creating an option page, there is the menu_slug. Maybe with this.

    And further. I have an option page. Several fields are created on this page. Let’s say the new user role should be able to see 9 of the 10 fields, only the one field should not be visible for him.

  • When adding an options page you can set the capability needed to access the page. This can be a capability or a user role.

    You can use acf/prepare_field to remove or allow fields based on the current use role or capability.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.