title: Add ACF admin column to custom post type
body: <p>I'm trying to add a new admin column to my custom post type using the content of a custom field (ACF). The field I want to add is a 'post object' field, but it just displays the post title instead of the linked post from the ACF. I added a screenshot.</p>
  
  <p><a href="https://i.stack.imgur.com/wr4ET.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wr4ET.png" alt="What I have now"></a></p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>function add_new_realisaties_column($columns) {
      $columns['realisatie_line'] = 'Line';
      return $columns;
  }
  add_filter('manage_realisaties_posts_columns', 'add_new_realisaties_column');
  
  function add_new_realisaties_admin_column_show_value( $column, $post_id ) {
  if ($column == 'realisatie_line') {
      $post_object = get_field('realisatie_line');
  
      if( $post_object ):
          // override $post
          $post = $post_object;
          setup_postdata( $post ); 
  
          $evdate = the_title();
  
          wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?&gt;
      &lt;?php endif; 
  
      echo $evdate;
      }
  }
  add_filter('manage_realisaties_posts_custom_column', 'add_new_realisaties_admin_column_show_value', 10, 2);
  
  /* Make the column sortable */
  function set_custom_realisaties_sortable_columns( $columns ) {
      $columns['realisatie_line'] = 'realisatie_line';
      return $columns;
  }
  add_filter( 'manage_edit-realisaties_sortable_columns', 'set_custom_realisaties_sortable_columns' );
  
  function realisaties_custom_orderby( $query ) {
      if ( ! is_admin() )
          return;
          $orderby = $query-&gt;get('orderby');
  
          if ( 'realisatie_line' == $orderby ) {
              $query-&gt;set( 'meta_key', 'realisatie_line' );
              $query-&gt;set( 'orderby', 'meta_value' );
          }
      }
  add_action( 'pre_get_posts', 'realisaties_custom_orderby' );
  </code></pre>