• 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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • As far as I can see, this is still an open issue with the Gutenberg developers: https://github.com/WordPress/gutenberg/issues/17854

    Thread Starter lepardman

    (@rickiwylder)

    Thanks for the reply @threadi, much appreciated! Yes, I am aware of the particular Github issue and have also made my voice heard in that thread. ?? But it’s four years old and I guess the situation is different now when the iframe solution is shipped? Which means I and many more devs (according to issue 17854 amongst others) need to find a solution to this. Maybe someone have figured out an alternative solution until core is “fixed”?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add classes to the Gutenberg iframe (editor-canvas) body tag?’ is closed to new replies.