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. (#49598)
  • Loading branch information
ramonjd authored Apr 6, 2023
1 parent 274cde3 commit 6ec3184
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 );

1 comment on commit 6ec3184

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 6ec3184.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4625910326
📝 Reported issues:

Please sign in to comment.