Templates: Deprecate _inject_theme_attribute_in_block_template_content.
It can be replaced by passing `_inject_theme_attribute_in_template_part_block` as second argument to `traverse_and_serialize_blocks()`. Per WordPress 6.4 Beta 1, there aren't going to be any more calls in Core to `_inject_theme_attribute_in_block_template_content()`. Note that `_inject_theme_attribute_in_block_template_content` has always had `@access private` set in its PHPDoc. Props gziolo. Fixes #59452. Built from https://develop.svn.wordpress.org/trunk@56719 git-svn-id: http://core.svn.wordpress.org/trunk@56231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
57f2930594
commit
70e906c26e
|
@ -475,12 +475,19 @@ function _flatten_blocks( &$blocks ) {
|
||||||
* stylesheet as a theme attribute into each wp_template_part
|
* stylesheet as a theme attribute into each wp_template_part
|
||||||
*
|
*
|
||||||
* @since 5.9.0
|
* @since 5.9.0
|
||||||
|
* @deprecated 6.4.0 Use traverse_and_serialize_blocks( parse_blocks( $template_content ), '_inject_theme_attribute_in_template_part_block' ) instead.
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
* @param string $template_content serialized wp_template content.
|
* @param string $template_content serialized wp_template content.
|
||||||
* @return string Updated 'wp_template' content.
|
* @return string Updated 'wp_template' content.
|
||||||
*/
|
*/
|
||||||
function _inject_theme_attribute_in_block_template_content( $template_content ) {
|
function _inject_theme_attribute_in_block_template_content( $template_content ) {
|
||||||
|
_deprecated_function(
|
||||||
|
__FUNCTION__,
|
||||||
|
'6.4.0',
|
||||||
|
'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_inject_theme_attribute_in_template_part_block" )'
|
||||||
|
);
|
||||||
|
|
||||||
$has_updated_content = false;
|
$has_updated_content = false;
|
||||||
$new_content = '';
|
$new_content = '';
|
||||||
$template_blocks = parse_blocks( $template_content );
|
$template_blocks = parse_blocks( $template_content );
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.4-alpha-56718';
|
$wp_version = '6.4-alpha-56719';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue