Changeset 56960
- Timestamp:
- 10/17/2023 03:46:44 PM (9 months ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-template-utils.php
r56943 r56960 548 548 } 549 549 550 $before_block_visitor = ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ? '_inject_theme_attribute_in_template_part_block' : null;550 $before_block_visitor = ; 551 551 $after_block_visitor = null; 552 552 $hooked_blocks = get_hooked_blocks(); … … 555 555 $after_block_visitor = make_after_block_visitor( $hooked_blocks, $template ); 556 556 } 557 if ( null !== $before_block_visitor || null !== $after_block_visitor ) { 558 $blocks = parse_blocks( $template_content ); 559 $template_content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 560 } 561 $template->content = $template_content; 557 $blocks = parse_blocks( $template_content ); 558 $template->content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 562 559 563 560 return $template; -
trunk/src/wp-includes/blocks.php
r56896 r56960 780 780 */ 781 781 return function ( &$block, $parent_block = null, $prev = null ) use ( $hooked_blocks, $context ) { 782 if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { 783 _inject_theme_attribute_in_template_part_block( $block ); 784 } 782 _inject_theme_attribute_in_template_part_block( $block ); 785 783 786 784 $markup = ''; -
trunk/src/wp-includes/class-wp-block-patterns-registry.php
r56896 r56960 166 166 $content = $pattern['content']; 167 167 168 $before_block_visitor = ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ? '_inject_theme_attribute_in_template_part_block' : null;168 $before_block_visitor = ; 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 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 } 174 $blocks = parse_blocks( $content ); 175 $content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 178 176 179 177 return $content; -
trunk/tests/phpunit/tests/block-template-utils.php
r56896 r56960 163 163 164 164 /** 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 165 223 * @ticket 59338 166 224 * -
trunk/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php
r56896 r56960 318 318 319 319 /** 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 320 343 * Should insert hooked blocks into registered patterns. 321 344 * … … 370 393 371 394 /** 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 372 418 * Should insert hooked blocks into registered patterns. 373 419 *
Note: See TracChangeset
for help on using the changeset viewer.