Navigation block: Remove more obsolete Block Hooks helpers#67193
Conversation
|
Flaky tests detected in e33647b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11950108503
|
| function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) { | ||
| $mock_navigation_block = block_core_navigation_mock_parsed_block( $inner_blocks, $post ); | ||
|
|
||
| if ( function_exists( 'apply_block_hooks_to_content' ) ) { |
There was a problem hiding this comment.
apply_block_hooks_to_content has been part of WP Core since 6.6 -- which is now the minimum requirement for Gutenberg, so it's guaranteed to exist.
| * @param string $serialized_block The serialized markup of a block and its inner blocks. | ||
| * @return string | ||
| */ | ||
| function block_core_navigation_remove_serialized_parent_block( $serialized_block ) { |
There was a problem hiding this comment.
This function is no longer used anywhere in the codebase (grep to verify).
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
- `block_core_navigation_remove_serialized_parent_block` was `replaced by remove_serialized_parent_block`. - `apply_block_hooks_to_content` has been part of WP Core since 6.6, so we don't need to check for its existence anymore. Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: draganescu <andraganescu@git.wordpress.org>
What?
Remove a number of Block Hooks related functions from the Navigation block.
Follow-up to #64676.
Why?
As of WP 6.6, Core has replaced usage of these functions by counterparts of its own:
block_core_navigation_remove_serialized_parent_blockwas replaced byremove_serialized_parent_block.And per #67117, 6.6 is the minimum required WordPress version for the Gutenberg plugin.
How?
By removing code.
Note
There's a companion PR in
wordpress-developto move these functions intodeprecated.php: WordPress/wordpress-develop#7849Testing Instructions
This should be covered by unit tests (which are run both against the current and previous WP versions).
In addition, you can smoke-test Block Hooks in the Navigation block as described in other related PRs, e.g. #59021.