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

Blocks: Introduce helper function to retrieve hooked blocks #5239

Closed

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Sep 18, 2023

Trac ticket: https://core.trac.wordpress.org/ticket/59383

In order to implement Block Hooks (see #59313), we added block_hooks field to the WP_Block_Type class, as well as to block registration related functions. In this follow-up, new helper function gets introduced that is going to compute the list of hooked blocks by other registered blocks for a given block type.

Extracted from #5158 and covered with unit tests.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ockham
Copy link
Contributor

ockham commented Sep 18, 2023

Looking good overall, just one request regarding tests.

For the other PRs we've filed for block hooks, I've actually filed separate tickets; it'd be great if we could do the same here 😊 (I can do that if you're busy with other things.)

Finally, just noting that I agree that we should eventually cache get_hooked_blocks as we discussed; but let's keep that for a follow-up.

@gziolo
Copy link
Member Author

gziolo commented Sep 18, 2023

For the other PRs we've filed for block hooks, I've actually filed separate tickets; it'd be great if we could do the same here 😊 (I can do that if you're busy with other things.)

Feel free to open another ticket. Otherwise, I'm fine referencing the existing ticket that covers the block hooks feature.

@gziolo gziolo force-pushed the update/introduce-get-hooked-blocks branch from 2105b3c to d2cfe58 Compare September 18, 2023 10:45
@gziolo
Copy link
Member Author

gziolo commented Sep 18, 2023

I addressed the feedback, and I will open a ticket for this functionality now that I have some additional time.

@gziolo
Copy link
Member Author

gziolo commented Sep 18, 2023

The ticket is https://core.trac.wordpress.org/ticket/59383.

Copy link
Contributor

@ockham ockham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! Let's update the two @ticket references in the tests to use the new number, and it's ready to go 🎉

Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
@gziolo
Copy link
Member Author

gziolo commented Sep 18, 2023

Committed with https://core.trac.wordpress.org/changeset/56610.

@gziolo gziolo closed this Sep 18, 2023
@gziolo gziolo deleted the update/introduce-get-hooked-blocks branch September 18, 2023 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants