Skip to content

Commit

Permalink
Remove check for hook added to rest_insert_wp_navigation action
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Aug 21, 2024
1 parent 193ae04 commit 74e8d69
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1626,15 +1626,6 @@ 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' );
}

/*
* 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 );
}

/**
* Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks.
*
Expand Down

0 comments on commit 74e8d69

Please sign in to comment.