Make WordPress Core

Changeset 56719


Ignore:
Timestamp:
09/26/2023 04:17:18 PM (7 months ago)
Author:
Bernhard Reiter
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template-utils.php

    r56649 r56719  
    476476 *
    477477 * @since 5.9.0
     478 * @deprecated 6.4.0 Use traverse_and_serialize_blocks( parse_blocks( $template_content ), '_inject_theme_attribute_in_template_part_block' ) instead.
    478479 * @access private
    479480 *
     
    482483 */
    483484function _inject_theme_attribute_in_block_template_content( $template_content ) {
     485    _deprecated_function(
     486        __FUNCTION__,
     487        '6.4.0',
     488        'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_inject_theme_attribute_in_template_part_block" )'
     489    );
     490
    484491    $has_updated_content = false;
    485492    $new_content         = '';
  • trunk/tests/phpunit/tests/block-template-utils.php

    r56644 r56719  
    312312    }
    313313
     314    /**
     315     * @ticket 59452
     316     *
     317     * @covers ::_inject_theme_attribute_in_block_template_content
     318     *
     319     * @expectedDeprecated _inject_theme_attribute_in_block_template_content
     320     */
    314321    public function test_inject_theme_attribute_in_block_template_content() {
    315322        $theme                           = get_stylesheet();
Note: See TracChangeset for help on using the changeset viewer.