Hi Everyone,
I can’t see the Preview of my Custom Post Type when Revisions are activated.
I’m using ACF-Pro V.5.7.7.
I know the problems with previewing Custom Post Types (working with ACF-Pro for many years now), but this one is new, as far as I can see.
Scenario:
1) Multisite (dont think this is a problem, never had any with multisites and ACF)
2) define( ‘WP_POST_REVISIONS’, 5 ); // in wp-configs.php
3) Custom Post Type (name = cpt-page) with: ‘supports’ => array(‘title’, ‘editor’, ‘revisions’)
Everything works fine except for the previews. Published cpt-pages show up normal. Saving the cpt-page to a draft works fine, all ACF fields get saved. Previewing the cpt-page is not working. When I now remove the support of revisions (in register_post_type) => preview works fine.
Setting the support for revisions back on => previewing stops working.
I know this is a topic often discussed, but I haven’t found a solution to this scenario yet.
I appreciate any ideas.
Found another clue.
I have a save_post action for saving the acf_fields in the normal editor (mainly for for Yoast and relevansii functionality). When I deactivate this function everything works fine. What I don’t understand is, that the function only acts, when !wp_is_post_revision($post_id) && !isset( $_GET[‘preview’] )
As far as I understand this function shouldn’t do anything while in preview mode.