Home › Forums › Backend Issues (wp-admin) › Populate field choices with wp_insert_post › Reply To: Populate field choices with wp_insert_post
I do not know because I don’t know how the data is being supplied.
Because your field is defined in PHP you must change the choices in PHP on every use of the field. What this means for you depends on what you need to do with the field choices and when you need them available. You may need to use acf/prepare_field or possibly acf/load_field or maybe even both.
The data that you want to use will need to be stored in some manor so that it can be loaded and used for the choices each time the field is used.
Where are you getting this data from that you’re using for the choices?
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!
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.