Skip to content
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

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Aug 21, 2024

What?

  • Remove a number of function_exists() guards that checked for existence of the set_ignored_hooked_blocks_metadata function.
  • 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.

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

@ockham ockham added [Type] Code Quality Issues or PRs that relate to code quality [Block] Navigation Affects the Navigation Block [Feature] Block hooks labels Aug 21, 2024
@ockham ockham self-assigned this Aug 21, 2024
@ockham ockham marked this pull request as ready for review August 21, 2024 09:16
@ockham ockham requested a review from ajitbohra as a code owner August 21, 2024 09:16
@ockham ockham requested review from gziolo and tjcafferkey August 21, 2024 09:17
Copy link

github-actions bot commented Aug 21, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ockham <[email protected]>
Co-authored-by: gziolo <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

Flaky tests detected in 74e8d69.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10486780343
📝 Reported issues:

Copy link
Member

@gziolo gziolo left a 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 👍🏻

@ockham ockham merged commit ab06c00 into trunk Aug 21, 2024
66 checks passed
@ockham ockham deleted the remove/now-obsolete-block-hooks-compat-checks branch August 21, 2024 14:01
@github-actions github-actions bot added this to the Gutenberg 19.1 milestone Aug 21, 2024
bph pushed a commit to bph/gutenberg that referenced this pull request Aug 31, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Feature] Block hooks [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants