Skip to content

Commit

Permalink
We need to remove the corresponding WP filters in the plugin so that …
Browse files Browse the repository at this point in the history
…we don't double up on styles when the plugin is active.
  • Loading branch information
ramonjd committed Apr 5, 2023
1 parent ef9ed1a commit eae4665
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/block-supports/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function _gutenberg_add_block_level_preset_styles( $pre_render, $block ) {
)
);

// include preset css classes on the the stylesheet.
// include preset css classes on the stylesheet.
$styles .= $theme_json_object->get_stylesheet(
array( 'presets' ),
null,
Expand All @@ -131,6 +131,8 @@ function _gutenberg_add_block_level_preset_styles( $pre_render, $block ) {

return null;
}

// Remove WordPress core filter to avoid rendering duplicate settings style blocks.
remove_filter( 'render_block', '_wp_add_block_level_presets_class', 10, 2 );
remove_filter( 'pre_render_block', '_wp_add_block_level_preset_styles', 10, 2 );
add_filter( 'render_block', '_gutenberg_add_block_level_presets_class', 10, 2 );
add_filter( 'pre_render_block', '_gutenberg_add_block_level_preset_styles', 10, 2 );

0 comments on commit eae4665

Please sign in to comment.