Make WordPress Core

Changeset 43940


Ignore:
Timestamp:
11/23/2018 12:41:56 AM (6 years ago)
Author:
pento
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.
See #45401.

File:
1 edited

Legend:

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

    r42597 r43940  
    40014001            $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
    40024002
     4003            // Remove the nextpage block delimiters, to avoid invalid block structures in the split content.
     4004            $content = str_replace( '<!-- wp:nextpage -->', '', $content );
     4005            $content = str_replace( '<!-- /wp:nextpage -->', '', $content );
     4006
    40034007            // Ignore nextpage at the beginning of the content.
    40044008            if ( 0 === strpos( $content, '<!--nextpage-->' ) )
Note: See TracChangeset for help on using the changeset viewer.