Skip to content
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

fix: remove extraneous param from remove_filter() calls #66697

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 );
Loading