-
Notifications
You must be signed in to change notification settings - Fork 799
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
Gutenberg: Add and use jetpack_register_block_type() wrapper #11310
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: March 5, 2019. |
9509c9d
to
3cf543a
Compare
ockham, Your synced wpcom patch D24145-code has been updated. |
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 works well for me. I only have one minor comment.
Thanks for adding the I know I'm the one who suggested the |
Yeah, you're right. It seems safe without it. Let's drop it. |
ockham, Your synced wpcom patch D24145-code has been updated. |
Changed the function name to |
Putting on hold to get #11312 in first. |
This should now be good to rebase. 👍 |
a4e71b1
to
08e7bce
Compare
08e7bce
to
86d3d34
Compare
ockham, Your synced wpcom patch D24145-code has been updated. |
Rebased. |
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.
Looking good. Merge when ready.
We introduced `jetpack_register_block_type` in #11310. But since we already have a wrapper function that we also deprecated. We end up with 2 functions `jetpack_register_block_type` and `jetpack_register_block` that do the same thing. This PR removed the new wrapper function in favour of the old one and ads a check that we don't call jetpack_register_block_type without `jetpack/` which is what we expect. #### Changes proposed in this Pull Request: * remove the newly added jetpack_register_block_type in favour of the old jetpack_register_block_type. #### Testing instructions: * Do the tests still pass? * Do the blocks still load in the editor? * Do you notice any php errors/notices? #### Proposed changelog entry I don't think this needs a changelog entry
This includes a
function_exists()
check to avoid usage ofregister_block_type
in older WordPress versions that don't yet have it, leading to fatals (which my recent #11212 caused -- very sorry!)Some convo (with @dereksmart and @jeherve) at p1549647686423800-slack-jetpack-gutenberg
Changes proposed in this Pull Request:
jetpack_register_block_type()
wrapper instead ofregister_block_type()
Testing instructions:
register_block_type
to make sure we're not calling it directly anymore.Follow-up
As a follow-up, we should modify
tests/php/test_class.jetpack-gutenberg.php
(andJetpack_Gutenberg
) so it won't skip tests on a WP installation withoutregister_block_type
to make sure thatJetpack_Gutenberg
doesn't fatal.Proposed changelog entry for your changes:
jetpack_register_block_type()
wrapper instead ofregister_block_type()