Elements: Deprecate old block support filter callbacks#59538
Elements: Deprecate old block support filter callbacks#59538aaronrobertshaw merged 6 commits intotrunkfrom
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. |
andrewserong
left a comment
There was a problem hiding this comment.
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. |
peterwilsoncc
left a comment
There was a problem hiding this comment.
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.
This refers to itself as the replacement in the third param.
There was a problem hiding this comment.
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_supportgutenberg_render_elements_support_styles(now it is used withrender_block_datathe arg should be an array).Testing Instructions
npm run test:unit:php:base -- --filter WP_Block_Supports_Elements_TestNext Steps