Ticket #45495: do_blocks.diff
File do_blocks.diff, 1.1 KB (added by , 6 years ago) |
---|
-
src/wp-includes/blocks.php
262 262 * @return string Updated post content. 263 263 */ 264 264 function do_blocks( $content ) { 265 // If there are blocks in this content, we shouldn't run wpautop() on it later.266 $priority = has_filter( 'the_content', 'wpautop' );267 if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) {268 remove_filter( 'the_content', 'wpautop', $priority );269 add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 );270 }271 272 265 $blocks = parse_blocks( $content ); 273 266 $output = ''; 274 267 … … 276 269 $output .= render_block( $block ); 277 270 } 278 271 272 // If there are blocks in this content, we shouldn't run wpautop() on it later. 273 $priority = has_filter( 'the_content', 'wpautop' ); 274 if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) { 275 remove_filter( 'the_content', 'wpautop', $priority ); 276 add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 ); 277 } 278 279 279 return $output; 280 280 }