Make WordPress Core


Ignore:
Timestamp:
11/09/2018 08:28:40 AM (6 years ago)
Author:
pento
Message:

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.

Props pento, nerrad.
Fixes #45290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/formatting.php

    r43752 r43879  
    442442    if ( trim($pee) === '' )
    443443        return '';
    444 
    445     // We don't need to autop posts with blocks in them.
    446     if ( has_blocks( $pee ) ) {
    447         return $pee;
    448     }
    449444
    450445    // Just to make things a little easier, pad the end.
Note: See TracChangeset for help on using the changeset viewer.