mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@44276 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4164,6 +4164,10 @@ class WP_Query {
|
||||
$content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
|
||||
$content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
|
||||
|
||||
// Remove the nextpage block delimiters, to avoid invalid block structures in the split content.
|
||||
$content = str_replace( '<!-- wp:nextpage -->', '', $content );
|
||||
$content = str_replace( '<!-- /wp:nextpage -->', '', $content );
|
||||
|
||||
// Ignore nextpage at the beginning of the content.
|
||||
if ( 0 === strpos( $content, '<!--nextpage-->' ) ) {
|
||||
$content = substr( $content, 15 );
|
||||
|
||||
Reference in New Issue
Block a user