Support

Account

Home Forums Add-ons Flexible Content Field Restrict flexible-content layouts to role

Helping

Restrict flexible-content layouts to role

  • Hey guys,

    We’re using ACF Pro for one of our customers.
    Along with it we’re using the flexible-content feature, so users can pick different layouts.

    We have two roles in WordPress: Admin and Editor.

    Is there any way I can restrict flexible-content layouts for the Editor role? So Admin can choose layout A, B and C but Editor only can choose B and C for example. I couldn’t find any filter or action for this purpose.

    Thanks in advance and best regards
    Nick

  • There isn’t a filter to directly effect layouts.

    I think you can use acf/prepare_field on the flex field. In the filter you should be able to loop over the layouts ($field[‘layouts’]) and remove layouts. See this https://support.advancedcustomfields.com/forums/topic/disable-layout-from-showing-in-template/#post-53129

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.