Support

Account

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!