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?