title: Call function in Wordpress after a custom post type updated/created with ACF
body: <p>I want to call a function every time there is a change in a custom post type. Either publish, update or delete. In that function, I fetch all posts from that custom post type and create a json file that I export in a file.</p>
  
  <pre><code>add_action( 'transition_post_status', 'get_resources_data', 10, 3 );
  
  function get_resources_data($new_status, $old_status, $post ) {
    if ($post-&gt;post_type == 'resources') {
      $args = array (
          'post_type' =&gt; 'resources',
          'post_status' =&gt; 'publish',
          'posts_per_page' =&gt; -1
      );
      $queryResults = new WP_Query( $args );
      if ( $queryResults-&gt;have_posts() ) {
          //do my stuff here
          //fetch acf fields with get_field()
          //create json file
          //export json file
      }
    }
  }
  </code></pre>
  
  <p>The problem is that the custom post type has a few advanced custom fields which I include in the JSON file. However, when a new post is created, all ACF are null, while fields such as title and creation data are available. If I update a post, all ACF are fetched.</p>
  
  <p>My impression is that <code>transition_post_status</code> is hooked before the ACF are stored in the Database. Should I use another action or do it with another way?</p>