Home Forums Feature Requests Inserting fields programatically Reply To: Inserting fields programatically

  • Ah okay.

    Well I don’t see what exactly you want.
    The update_field will work as long as there are actual fields to the content you want to add them to, they don’t need to already have content.

    And to create fields completely from scratch you’d use the PHP functions already available like acf_add_local_field().

    There’s no point in a insert_field() function as it would either do the same as acf_add_local_field() or just add meta to content. In the latter case it wouldn’t be helpful since there’s no actual ACF field to go with it.

    There is however a plan to create a new api function for inserting new rows into a repeater or flexible field. That is currently a bit tricky (but doable) and it will be much easier!