Support

Account

Home Forums General Issues Set a field's value to null or other value?

Helping

Set a field's value to null or other value?

  • Hi,

    I want to have two fields. One (field A) that is a yes or no choise typ. If that field (field A) is Yes then another field (field B) will be shown and get a default value. If Field A is no then field B is set to a defauld value or null.

    Is this possible with the free subscription through the user interface? Or through code? I’ve seen that you can do changes to the plugin, would anyone know a video or other source to learn how to make those changes?

    Kind Regards

    David

  • I don’t know of any video. The steps are not difficult.

    You create an acf/save_post filter https://www.advancedcustomfields.com/resources/acf-save_post/

    In this filter you get the value of the true/false field and then you can use update_field() https://www.advancedcustomfields.com/resources/update_field/ to change the value of the other field based on what the true/false field value is.

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.