Formatting: Ensure wpautop() isn't run on content generated from blocks.

As `do_blocks()` is run before `wpautop()` in the_content filter, we can remove in a Just In Time fashion, before that filter is run.

After `wpautop()`s original priority has passed, we can re-add it in a Just Too Late fashion, to ensure it's available if `the_content` filter is run multiple times on a page load.

Merges [43879] and [43881] from the 5.0 branch to trunk.

Props pento, nerrad.
Fixes #45290.


git-svn-id: https://develop.svn.wordpress.org/trunk@44226 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt
2018-12-16 02:22:43 +00:00
parent deab4810d0
commit 415f33c904
3 changed files with 60 additions and 6 deletions
-5
View File
@@ -458,11 +458,6 @@ 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";