Support

Account

Home Forums ACF PRO Dynamically deactivate fields after Object load

Unread

Dynamically deactivate fields after Object load

    • highdiv

    • March 10, 2019 at 1:37 pm

    Hello,
    I’m pretty new to PHP and WordPress, but ended up building a template generator with the help of ACF it works with 2 custom post fields, template and Client. The Client picks via “post object” the Template and has a predefined set of options. It would be easy if there would be only 1 template for each category, but there are multiple. So i need an option to prevent options to get passed. At the moment i added to each option Field a textfield that passes ‘deactivated’ when the option is disabled. it works via update_field

    TEMPLATE
    option_1
    set_option_1 activate / deactivate

    Client
    choose_template
    option 1
    get_option_1 activate / deactivate

    In the last days I switched from manually setting the fields in the backend to generate them via acf_add_local_field_group. So my question is now, is it possible to hook an action to the selection of the Template field, get rid of the “deactivate fields” and directly deactivate the clients field?

Viewing 1 post (of 1 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.