Skip to content

Commit

Permalink
Correct comment
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Mar 12, 2024
1 parent 672c443 commit dae0b2d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ private static function get_nav_wrapper_attributes( $attributes, $inner_blocks )
/**
* Gets the nav element directives.
*
* @param bool $is_interactive Whether the block is interactive.
* @param bool $is_interactive Whether the block is interactive.
* @return string the directives for the navigation element.
*/
private static function get_nav_element_directives( $is_interactive ) {
Expand Down Expand Up @@ -1499,11 +1499,13 @@ function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
add_filter( 'rest_pre_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta', 10 );
}

// Previous versions of Gutenberg and WordPress 6.5 Betas were attaching the block_core_navigation_update_ignore_hooked_blocks_meta
// function to the `rest_insert_wp_navigation` _action_ (rather than the `rest_pre_insert_wp_navigation` _filter_).
// To avoid collisions, we need to remove the filter from that action if it's present.
/*
* Previous versions of Gutenberg were attaching the block_core_navigation_update_ignore_hooked_blocks_meta
* function to the `rest_insert_wp_navigation` _action_ (rather than the `rest_pre_insert_wp_navigation` _filter_).
* To avoid collisions, we need to remove the filter from that action if it's present.
*/
if ( has_filter( 'rest_insert_wp_navigation', $rest_insert_wp_navigation_core_callback ) ) {
remove_filter( 'rest_insert_wp_navigation', $rest_insert_wp_navigation_core_callback, 10 );
remove_filter( 'rest_insert_wp_navigation', $rest_insert_wp_navigation_core_callback );
}

/**
Expand Down

0 comments on commit dae0b2d

Please sign in to comment.