Home › Forums › Add-ons › Gallery Field › meta_input wp_insert_post acf gallery › Reply To: meta_input wp_insert_post acf gallery
ACF has two fields that must be present. These are the field value and field key reference.
So for example let’s say the the field name is “gallery” and the field key is “field_123456”
A gallery field is an array of the attachment ID values from the media folder
'meta_input = array(
'gallery' => array($attachment_id), // field value
'_gallery' => 'field_123456' // field key reverence
)
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.