Home › Forums › ACF PRO › How to auto-populate a field getting values from other fields? › Reply To: How to auto-populate a field getting values from other fields?
You’re trying to set the default value. The default value is only used on new posts. When this is first run on a new post, both of the other fields will have no value so you’re setting the default value to nothing. After the post is saved the first time the default value is ignored.
If you want this field set based on the other fields then I would suggest an acf/save_post action that updates this field when the post is saved, https://www.advancedcustomfields.com/resources/acf-save_post/, https://www.advancedcustomfields.com/resources/update_field/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.