Home Forums General Issues Issue wirth WordPress Preview and ACF Fields


Issue wirth WordPress Preview and ACF Fields

    • jochen

    • December 6, 2018 at 2:12 am

    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.

    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.

    • jochen

    • December 6, 2018 at 3:44 am

    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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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.