Changeset 45139
- Timestamp:
- 04/08/2019 06:53:14 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r44576 r45139 263 263 */ 264 264 function do_blocks( $content ) { 265 $blocks = parse_blocks( $content ); 266 $output = ''; 267 268 foreach ( $blocks as $block ) { 269 $output .= render_block( $block ); 270 } 271 265 272 // If there are blocks in this content, we shouldn't run wpautop() on it later. 266 273 $priority = has_filter( 'the_content', 'wpautop' ); … … 270 277 } 271 278 272 $blocks = parse_blocks( $content );273 $output = '';274 275 foreach ( $blocks as $block ) {276 $output .= render_block( $block );277 }278 279 279 return $output; 280 280 } -
trunk/tests/phpunit/tests/blocks/render.php
r44785 r45139 85 85 86 86 function handle_shortcode( $atts, $content ) { 87 return $content; 88 } 89 90 /** 91 * @ticket 45495 92 */ 93 function test_nested_calls_to_the_content() { 94 register_block_type( 95 'core/test', 96 array( 97 'render_callback' => array( 98 $this, 99 'dynamic_the_content_call', 100 ), 101 ) 102 ); 103 104 $content = "foo\n\nbar"; 105 106 $the_content = apply_filters( 'the_content', '<!-- wp:core/test -->' . $content . '<!-- /wp:core/test -->' ); 107 108 $this->assertSame( $content, $the_content ); 109 } 110 111 function dynamic_the_content_call( $attrs, $content ) { 112 apply_filters( 'the_content', '' ); 87 113 return $content; 88 114 }
Note: See TracChangeset
for help on using the changeset viewer.