mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 04:04:35 +00:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user