Blocks: Parse blocks when displaying posts.

Posts containing blocks are now correctly handled when displaying on the front end, including dynamic blocks and nested blocks.

Props pento.

Merges [43752] to trunk.

See #45109.

git-svn-id: https://develop.svn.wordpress.org/trunk@44118 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2018-12-13 18:11:10 +00:00
parent 6aef7e1966
commit 93091fac36
71 changed files with 1419 additions and 24 deletions

View File

@@ -458,6 +458,11 @@ function wpautop( $pee, $br = true ) {
return '';
}
// We don't need to autop posts with blocks in them.
if ( has_blocks( $pee ) ) {
return $pee;
}
// Just to make things a little easier, pad the end.
$pee = $pee . "\n";
@@ -3635,6 +3640,7 @@ function wp_trim_excerpt( $text = '' ) {
$text = get_the_content( '' );
$text = strip_shortcodes( $text );
$text = strip_dynamic_blocks( $text );
/** This filter is documented in wp-includes/post-template.php */
$text = apply_filters( 'the_content', $text );