-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation block: Remove more obsolete Block Hooks helpers #67193
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
|
@@ -1504,19 +1490,6 @@ function block_core_navigation_mock_parsed_block( $inner_blocks, $post ) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
- `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 <[email protected]> Co-authored-by: draganescu <[email protected]>
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_block
was 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-develop
to 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.