-
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 now-obsolete function_exists guards #64673
Conversation
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. |
Flaky tests detected in 74e8d69. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10486780343
|
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.
It makes perfect sense now that set_ignored_hooked_blocks_metadata
is always present 👍🏻
…ss#64673) - Remove a number of `function_exists()` guards that checked for existence of the `set_ignored_hooked_blocks_metadata` function. (That function was introduced in WP 6.5, and Gutenberg now requires WP 6.5 as a minimum.) - Delete code that checked if the `block_core_navigation_update_ignore_hooked_blocks_meta` function was attached to the `rest_insert_wp_navigation` _action_ hook, and removed it if it was. Co-authored-by: ockham <[email protected]> Co-authored-by: gziolo <[email protected]>
What?
function_exists()
guards that checked for existence of theset_ignored_hooked_blocks_metadata
function.block_core_navigation_update_ignore_hooked_blocks_meta
function was attached to therest_insert_wp_navigation
action hook, and removed it if it was.Why?
The
set_ignored_hooked_blocks_metadata
function was introduced in WP 6.5, and Gutenberg now requires WP 6.5 as a minimum.Same for the
block_core_navigation_update_ignore_hooked_blocks_meta
action removal: This was only relevant for older GB versions and during some WP 6.5 Betas (see the original phrasing of the comment here); it is now obsolete.How?
By removing them 🤷♂️
Testing 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.
Follow-up
We'll be able to remove even more code once WP 6.7 is the minimum requirement for Gutenberg: #64676