Home › Forums › Backend Issues (wp-admin) › Why doesn't this work on acf/save_post when attaching gallery ids? › Reply To: Why doesn't this work on acf/save_post when attaching gallery ids?
Does the field with the key field_63a6bd5d2a3d2 actually exist on the page/post that is being submitted?
Assuming this is the case.
Your save_post action has a priority of 1. ACF runs on the save_post hook with a priority of 10. Your action is running before ACF saves field values. When ACF saves the field values it updates the same field with whatever was submitted in the form, overwriting what you did.
This is why it is important to use the acf/save_post hook instead of the standard save_post hook with the correct priority to run either before or after ACF has saved values.
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.