diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 829d916bfd..8791f93642 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -262,13 +262,6 @@ function parse_blocks( $content ) { * @return string Updated post content. */ function do_blocks( $content ) { - // If there are blocks in this content, we shouldn't run wpautop() on it later. - $priority = has_filter( 'the_content', 'wpautop' ); - if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) { - remove_filter( 'the_content', 'wpautop', $priority ); - add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 ); - } - $blocks = parse_blocks( $content ); $output = ''; @@ -276,6 +269,13 @@ function do_blocks( $content ) { $output .= render_block( $block ); } + // If there are blocks in this content, we shouldn't run wpautop() on it later. + $priority = has_filter( 'the_content', 'wpautop' ); + if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) { + remove_filter( 'the_content', 'wpautop', $priority ); + add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 ); + } + return $output; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 6f4adf7b80..f8a256b68f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-beta1-45138'; +$wp_version = '5.2-beta1-45139'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.