Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#59452 closed enhancement (fixed)

Templates: Deprecate _inject_theme_attribute_in_block_template_content().

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

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.


3 years 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
3 years ago

  • Description modified (diff)

#3 @Bernhard Reiter
3 years ago

  • Description modified (diff)
  • Summary Templates: Deprecate _inject_theme_attribute_in_template_part_block(). → Templates: Deprecate _inject_theme_attribute_in_block_template_content().

#4 @Bernhard Reiter
3 years ago

  • Resolution → fixed
  • Status assigned → 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.


3 years 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
3 years 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.