-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way to stop the wp-container-{id} class from being output in the Group block? #38127
Comments
This should do the trick: remove_filter( 'render_block', 'gutenberg_render_layout_support_flag' );
add_filter( 'render_block', function( $block_content, $block ) {
if ( $block['blockName'] === 'core/group' ) {
return $block_content;
}
return gutenberg_render_layout_support_flag( $block_content, $block );
}, 10, 2 ); This will remove the function that creates this class in the first place and then adds it again for every other block type. |
Thank you. But that didn't work out. |
However, I was able to remove
|
It took some digging but this is the proper way to do it specifically in the Gutenberg Editor
Do this in your plain JS file enqueued in the Gutenberg Editor |
As it is used in various blocks, not just groups, I have found this specification necessary. So I will close. |
In WordPress 6.1, a theme support option was added to opt out of these inlined layout styles and dynamic classes.
https://make.wordpress.org/core/2022/10/10/updated-editor-layout-support-in-6-1-after-refactor/ I found that the previous answer's solution (removing the |
For classic themes that are not FSE themes, I don't think
wp-container-{id}
is necessary.I would like to have the ability to turn off this class, as I feel this makes the HTML look messy.
On the other hand, as I wrote in #38126, I need a class that can determine that it is a "Row" block.
The text was updated successfully, but these errors were encountered: