-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Templates: Deprecate _inject_theme_attribute_in_block_template_content(). #5307
Templates: Deprecate _inject_theme_attribute_in_block_template_content(). #5307
Conversation
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.
It makes perfect sense 👍🏻
Thank you for working on it.
* @access private | ||
* | ||
* @param string $template_content serialized wp_template content. | ||
* @return string Updated 'wp_template' content. | ||
*/ | ||
function _inject_theme_attribute_in_block_template_content( $template_content ) { | ||
_deprecated_function( __FUNCTION__, '6.4.0' ); |
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.
I think you can also put the message with the new recommendation as 3rd argument in the call.
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.
Committed to Core in https://core.trac.wordpress.org/changeset/56719. |
I'd like to deprecate
_inject_theme_attribute_in_block_template_content()
, as it can be replaced by using_inject_theme_attribute_in_template_part_block()
in combination withtraverse_and_serialize_blocks()
on the parsed template blocks instead. Note that the function has always had@access private
set in its PHPDoc.The only code in Core that it's called from is synced from Gutenberg (dynamic blocks' PHP code).
get_block_file_template
for rendering gutenberg#52892. This change will be synced to Core before Beta 1.Trac ticket: https://core.trac.wordpress.org/ticket/59452
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.