Home › Forums › Bug Reports › Hooking in save_post_{$post->post_type} and update_field › Reply To: Hooking in save_post_{$post->post_type} and update_field
OK, after two days I finally found what was going on… Well, I was inspired by this post in WP reference (such a precious place of knowledge)…
As I said in the first post, I used the do_action( “save_post_{$post->post_type}”, int $post_ID, WP_Post $post, bool $update ) hook point. And according to the post above, this hook fires before the generic do_action( ‘save_post’, int $post_ID, WP_Post $post, bool $update ), so what I was saving in my hook point (in regard to the ACF fields) was overwritten when the generic hook was firing…
So I used the generic one instead, and did a check where this was true $post->post_type == ‘movie’
That was all that was needed! No need priority settings, nothing… Just this was enough to solve my problem!!! Amazing!
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?
— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.