Make WordPress Core


Ignore:
Timestamp:
12/17/2018 07:28:49 PM (6 years ago)
Author:
desrosj
Message:

Query: Remove nextpage block delimiters when setting up global post data.

WP_Query::setup_postdata() splits the post up by <!--nextpage-->, which causes invalid block data to be contained in the post content.

This change removes the <!-- wp:nextpage --> and <!-- /wp:nextpage -->, as well.

Props pento, youknowriad, azaozz, noisysocks.

Merges [43940] into trunk.

See #45401.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-includes/class-wp-query.php

    r43582 r44276  
    41654165            $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
    41664166
     4167            // Remove the nextpage block delimiters, to avoid invalid block structures in the split content.
     4168            $content = str_replace( '<!-- wp:nextpage -->', '', $content );
     4169            $content = str_replace( '<!-- /wp:nextpage -->', '', $content );
     4170
    41674171            // Ignore nextpage at the beginning of the content.
    41684172            if ( 0 === strpos( $content, '<!--nextpage-->' ) ) {
Note: See TracChangeset for help on using the changeset viewer.