@acf-support Could you post an example of using update_sub_field() to add data to a field inside a flexible content layout?
I can’t see any example for other than a repeater field in the doc page and tried using the Flexible Content field name and field and value but no luck yet.
update_sub_field( array( 'my_fc_layout_field_name', 1, 'document' ), 623 );
In the screenshot is reflected my Flexible Content field and Layout with field (document) I want to add the media ID value 623.
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!