Home › Forums › Add-ons › Flexible Content Field › update_field and flexible field › Reply To: update_field and flexible field
@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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.