- Timestamp:
- 10/12/2023 04:39:27 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-patterns-registry.php
r56835 r56896 166 166 $content = $pattern['content']; 167 167 168 $before_block_visitor = '_inject_theme_attribute_in_template_part_block';168 $before_block_visitor = ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ? '_inject_theme_attribute_in_template_part_block' : null; 169 169 $after_block_visitor = null; 170 170 if ( ! empty( $hooked_blocks ) || has_filter( 'hooked_block_types' ) ) { … … 172 172 $after_block_visitor = make_after_block_visitor( $hooked_blocks, $pattern ); 173 173 } 174 $blocks = parse_blocks( $content ); 175 $content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 174 if ( null !== $before_block_visitor || null !== $after_block_visitor ) { 175 $blocks = parse_blocks( $content ); 176 $content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 177 } 176 178 177 179 return $content;
Note: See TracChangeset
for help on using the changeset viewer.