Make WordPress Core


Ignore:
Timestamp:
12/16/2018 02:22:43 AM (8 years ago)
Author:
jeremyfelt
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.

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

Props pento, nerrad.
Fixes #45290.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-includes/formatting.php

    r44118 r44226  
    457457        if ( trim( $pee ) === '' ) {
    458458                return '';
    459         }
    460 
    461         // We don't need to autop posts with blocks in them.
    462         if ( has_blocks( $pee ) ) {
    463                 return $pee;
    464459        }
    465460
Note: See TracChangeset for help on using the changeset viewer.