Support

Account

Home Forums General Issues Preview Solution! 10 years later

Unread

Preview Solution! 10 years later

  • TL;DR Syntaxe update on the still working solution.

    10 years later I still have the same problem with the preview (not related to ACF here but to with the WP featured image).

    I gave a solution in this forum thread Preview solution !

    I cannot post a reply in the original thread because it’s closed but I wanted to keep a track of the updated code solution for me (or anyone) in the future that will loose their mind debugging the WP preview.

    You can se the problem in this old image
    Preview issue

    The code in the previous thread is still working but needs a little update on the syntaxe.

    So here is the solution updated (put this code on your function.php file):

    `
    /*
    Debug preview with custom fields
    */

    add_filter(‘_wp_post_revision_fields’, function($fields){
    $fields[“debug_preview”] = “debug_preview”;
    return $fields;
    });

    add_action(‘edit_form_after_title’, function () {
    echo ‘<input type=”hidden” name=”debug_preview” value=”debug_preview”>’;
    });
    `

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.