From 7719742d3994f5fe841df861a7b02712627a2a81 Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:03:10 +1000 Subject: [PATCH] Remove core render_block filter for adding class to markup --- lib/block-supports/elements.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/block-supports/elements.php b/lib/block-supports/elements.php index 4cfd065954d415..eefab9ceffbafd 100644 --- a/lib/block-supports/elements.php +++ b/lib/block-supports/elements.php @@ -226,5 +226,6 @@ function gutenberg_render_elements_class_name( $block_content, $block ) { // Remove WordPress core filters to avoid rendering duplicate elements stylesheet & attaching classes twice. remove_filter( 'render_block', 'wp_render_elements_support', 10, 2 ); remove_filter( 'pre_render_block', 'wp_render_elements_support_styles', 10, 2 ); +remove_filter( 'render_block', 'wp_render_elements_class_name', 10, 2 ); add_filter( 'render_block', 'gutenberg_render_elements_class_name', 10, 2 ); add_filter( 'render_block_data', 'gutenberg_render_elements_support_styles', 10, 2 );