Skip to content

Commit

Permalink
fix rename filter for greater clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed Feb 7, 2024
1 parent 851f039 commit a9c5864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private static function does_block_need_a_list_item_wrapper( $block ) {
* @param array $needs_list_item_wrapper The list of blocks that need a list item wrapper.
* @return array The list of blocks that need a list item wrapper.
*/
$needs_list_item_wrapper = apply_filters( 'block_core_navigation_needs_list_item_wrapper', static::$needs_list_item_wrapper );
$needs_list_item_wrapper = apply_filters( 'block_core_navigation_blocks_requiring_list_item_wrapper', static::$needs_list_item_wrapper );

return in_array( $block->name, $needs_list_item_wrapper, true );
}
Expand Down
4 changes: 2 additions & 2 deletions phpunit/blocks/class-wp-navigation-block-renderer-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function test_gutenberg_block_is_automatically_wrapped_with_li_tag_when_f
};

add_filter(
'block_core_navigation_needs_list_item_wrapper',
'block_core_navigation_blocks_requiring_list_item_wrapper',
$filter_needs_list_item_wrapper_function,
10,
1
Expand All @@ -154,7 +154,7 @@ public function test_gutenberg_block_is_automatically_wrapped_with_li_tag_when_f
$expected = '<li class="wp-block-navigation-item"><div class="wp-block-testsuite-sample-block">Hello World</div></li>';
$this->assertEquals( $expected, $result );

remove_filter( 'block_core_navigation_needs_list_item_wrapper', $filter_needs_list_item_wrapper_function, 10, 1 );
remove_filter( 'block_core_navigation_blocks_requiring_list_item_wrapper', $filter_needs_list_item_wrapper_function, 10, 1 );

unregister_block_type( 'testsuite/sample-block' );
}
Expand Down

0 comments on commit a9c5864

Please sign in to comment.