-
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
Plugin: Ensure that Block Hooks work correctly after landing in WP core #54651
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.4/block-hooks.php ❔ lib/compat/wordpress-6.4/class-gutenberg-rest-block-patterns-controller.php ❔ phpunit/tests/blocks/renderHookedBlocks.php |
cd80553
to
b90afcb
Compare
I don't think we need to cover with unit tests the polyfill for Block Hooks anymore so I removed them with b90afcb. I don't think we run E2E tests with the older major versions of WordPress, so we should just test it manually with WordPress 6.3 before landing the PR. |
Flaky tests detected in b90afcb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6259312996
|
I opened a PR against core that documents the latest behavior for edge cases when dealing with Block Hooks at positions |
b90afcb
to
3f56b22
Compare
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.
- Code looks good ✅
- Tested the plugin zip produced by this PR in a local dev environment running Core
trunk
. Verified that hooked blocks are correctly inserted both on the frontend and in the editor ✅ - Tested the plugin with a throwaway test site with WP 6.3. Verified that hooked blocks are correctly inserted both on the frontend and in the editor ✅
Thank you!
I just cherry-picked this PR to the release/16.7 branch to get it included in the next release: 0790b09 |
…re (#54651) * Plugin: Ensure that Block Hooks work correctly after landing in WP core * Ensure that unit tests cover gutenberg_serialize_blocks polyfill
@mikachan Any chance we can also include this in 6.4? Not super urgent, so it's okay if we miss Beta 1, but would be handy to get into e.g. Beta 2. (See WordPress/wordpress-develop#5307) |
Yes! This PR should be included in 6.4 Beta 1, I'll confirm if not and re-add the "Backport to WP Beta/RC" label. |
This PR seems to break template parts: #55202 |
What?
Part of #53987.
Includes necessary changes to ensure that Block Hooks continues working correctly after Porting PHP code to Core.
Why?
At the moment, hooked blocks get inserted twice:
How?
Everything should continue working as in WordPress core. Hooked blocks should be inserted only once:
The challenge is that it has to be tested with WordPress 6.3 and WordPress 6.4 alpha.
Other than that all PHP unit tests should pass.
Testing Instructions