Add classes to the Gutenberg iframe (editor-canvas) body tag?
-
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)
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.