2

I believe Gutenberg content was iframed in WP 6.2 if all blocks are v3. I have used a function like below to add very important custom classes to my admin body tags which in turn alters how the content is presented. This is important for layout and consistency.

add_filter('admin_body_class', function ($classes) {
    global $pagenow;

    //check if the current page is post.php and if the post parameters set
    if ( $pagenow ==='post.php' || $pagenow ==='post-new.php' ) {
        global $post;
        
        /* ... */

        $classes .= ' super-important-editing-class';
        
    } 

    return $classes;
});

I've searched like crazy to find a filter which makes me do the same thing on the iframes body tag ('block-editor-iframe__body editor-styles-wrapper ...').

Does anyone know a way to do this?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.