-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Elements: Deprecate old block support filter callbacks #59538
Elements: Deprecate old block support filter callbacks #59538
Conversation
This pull request changed or added PHP files in previous commits, but none have been detected in the latest commit. Thank you! ❤️ |
I'll be AFK for just over a week, so my connection and bandwidth might be limited in addressing any feedback until the middle of next week. |
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. |
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.
Thanks for the follow-up! The elements styles are still being output correctly, and the deprecated calls all look good to me. I'm not super confident with my understanding of PHP deprecated calls, though, so it might be worth getting a second opinion from @peterwilsoncc, but overall this LGTM!
Acknowledging I've seen this but I'm ignoring anything that isn't going to hit WordPress 6.5 until after the release. |
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 looks good to me folks, just a minor note about a self referential deprecation notice.
Once that's fixed, this is good to merge.
lib/block-supports/elements.php
Outdated
* @return string Filtered block content. | ||
*/ | ||
function gutenberg_render_elements_support( $block_content ) { | ||
_deprecated_function( __FUNCTION__, '6.6.0', 'gutenberg_render_elements_support' ); |
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 refers to itself as the replacement in the third param.
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.
Thanks for catching that @peterwilsoncc! 🙈
I've fixed it and the docblock in 92ebee5
The changes from this PR and #59535 are combined in a single backport available in WordPress/wordpress-develop#6214. |
Addresses: #59535 (comment)
What?
Why?
Whether the callback functions were part of a private API and not documented publicly or not, if it could be used, it might have been so better to deprecate the function or argument as required.
How?
gutenberg_render_elements_support
gutenberg_render_elements_support_styles
(now it is used withrender_block_data
the arg should be an array).Testing Instructions
npm run test:unit:php:base -- --filter WP_Block_Supports_Elements_Test
Next Steps