Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#59452 closed enhancement (fixed)

Templates: Deprecate _inject_theme_attribute_in_block_template_content().

Reported by: bernhard-reiter's profile Bernhard Reiter Owned by: bernhard-reiter's profile Bernhard Reiter
Milestone: 6.4 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description (last modified by Bernhard Reiter)

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 with traverse_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).

Change History (8)

This ticket was mentioned in PR #5307 on WordPress/wordpress-develop by @Bernhard Reiter.


12 months ago
#1

  • Keywords has-patch added

I'd like to deprecate _inject_theme_attribute_in_template_part_block(), as it can be replaced by using _inject_theme_attribute_in_template_part_block() in combination with traverse_and_serialize_blocks() on the parsed template blocks instead.

The only code in Core that it's called from is synced from Gutenberg (dynamic blocks' PHP code).

Trac ticket: https://core.trac.wordpress.org/ticket/59452

#2 @Bernhard Reiter
12 months ago

  • Description modified (diff)

#3 @Bernhard Reiter
12 months ago

  • Description modified (diff)
  • Summary changed from Templates: Deprecate _inject_theme_attribute_in_template_part_block(). to Templates: Deprecate _inject_theme_attribute_in_block_template_content().

#4 @Bernhard Reiter
12 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 56719:

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.

This ticket was mentioned in PR #5317 on WordPress/wordpress-develop by @Bernhard Reiter.


12 months ago
#6

Move the now-deprecated function _inject_theme_attribute_in_block_template_content from wp-includes/block-template-utils.php to wp-includes/deprecated.php.

Trac ticket: https://core.trac.wordpress.org/ticket/59452

#7 @Bernhard Reiter
12 months ago

In 56722:

Templates: Move old theme attr injection function to deprecated.php.

Move the now-deprecated function _inject_theme_attribute_in_block_template_content from wp-includes/block-template-utils.php to wp-includes/deprecated.php.

Follow-up [56719].
Props spacedmonkey, davidbaumwald, mukesh27.
See #59452.

Note: See TracTickets for help on using tickets.