Skip to content

Commit

Permalink
fix: remove extraneous param from remove_filter() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed Nov 2, 2024
1 parent 49c3bf9 commit f770aa0
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 );

0 comments on commit f770aa0

Please sign in to comment.