Changeset 56896 for trunk/src/wp-includes/block-template-utils.php
- Timestamp:
- 10/12/2023 04:39:27 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/block-template-utils.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-template-utils.php
r56819 r56896 550 550 } 551 551 552 $before_block_visitor = '_inject_theme_attribute_in_template_part_block';552 $before_block_visitor = ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ? '_inject_theme_attribute_in_template_part_block' : null; 553 553 $after_block_visitor = null; 554 554 $hooked_blocks = get_hooked_blocks(); … … 557 557 $after_block_visitor = make_after_block_visitor( $hooked_blocks, $template ); 558 558 } 559 $blocks = parse_blocks( $template_content ); 560 $template->content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 559 if ( null !== $before_block_visitor || null !== $after_block_visitor ) { 560 $blocks = parse_blocks( $template_content ); 561 $template_content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 562 } 563 $template->content = $template_content; 561 564 562 565 return $template;
Note: See TracChangeset
for help on using the changeset viewer.