Skip to content

Commit

Permalink
fix: remove extraneous param from remove_filter() calls (#66697)
Browse files Browse the repository at this point in the history
Co-authored-by: justlevine <[email protected]>
Co-authored-by: gziolo <[email protected]>
  • Loading branch information
3 people authored Dec 23, 2024
1 parent d22e81b commit dda9e56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/block-supports/elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ function gutenberg_render_elements_class_name( $block_content, $block ) {
}

// Remove deprecated WordPress core filters.
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_support', 10 );
remove_filter( 'pre_render_block', 'wp_render_elements_support_styles', 10 );

// Remove WordPress core filters to avoid rendering duplicate elements stylesheet & attaching classes twice.
remove_filter( 'render_block', 'wp_render_elements_class_name', 10, 2 );
remove_filter( 'render_block_data', 'wp_render_elements_support_styles', 10, 1 );
remove_filter( 'render_block', 'wp_render_elements_class_name', 10 );
remove_filter( 'render_block_data', 'wp_render_elements_support_styles', 10 );

add_filter( 'render_block', 'gutenberg_render_elements_class_name', 10, 2 );
add_filter( 'render_block_data', 'gutenberg_render_elements_support_styles', 10, 1 );
6 changes: 3 additions & 3 deletions lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,8 @@ static function ( $matches ) {
}

if ( function_exists( 'wp_restore_group_inner_container' ) ) {
remove_filter( 'render_block', 'wp_restore_group_inner_container', 10, 2 );
remove_filter( 'render_block_core/group', 'wp_restore_group_inner_container', 10, 2 );
remove_filter( 'render_block', 'wp_restore_group_inner_container', 10 );
remove_filter( 'render_block_core/group', 'wp_restore_group_inner_container', 10 );
}
add_filter( 'render_block_core/group', 'gutenberg_restore_group_inner_container', 10, 2 );

Expand Down Expand Up @@ -1118,6 +1118,6 @@ function gutenberg_restore_image_outer_container( $block_content, $block ) {
}

if ( function_exists( 'wp_restore_image_outer_container' ) ) {
remove_filter( 'render_block_core/image', 'wp_restore_image_outer_container', 10, 2 );
remove_filter( 'render_block_core/image', 'wp_restore_image_outer_container', 10 );
}
add_filter( 'render_block_core/image', 'gutenberg_restore_image_outer_container', 10, 2 );
4 changes: 2 additions & 2 deletions lib/block-supports/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ 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 );
remove_filter( 'render_block', '_wp_add_block_level_presets_class', 10 );
remove_filter( 'pre_render_block', '_wp_add_block_level_preset_styles', 10 );
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 dda9e56

@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 dda9e56.
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/12464276209
📝 Reported issues:

Please sign in to comment.