From 0960ef74846c70c5a575d63c7c249431aded5839 Mon Sep 17 00:00:00 2001 From: "Drew Jaynes (DrewAPicture)" Date: Fri, 28 Nov 2014 12:17:27 +0000 Subject: [PATCH] 4.1 Docs Audit: Improve inline documentation for the new `WP_Query::setup_postdata()` method. See #30469. git-svn-id: https://develop.svn.wordpress.org/trunk@30620 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/query.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index 559ce807d4..371a937125 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -4558,8 +4558,10 @@ class WP_Query { if ( ! $page ) $page = 1; - // Force full post content when viewing the permalink for the $post, or - // when on an RSS feed. Otherwise respect the 'more' tag. + /* + * Force full post content when viewing the permalink for the $post, + * or when on an RSS feed. Otherwise respect the 'more' tag. + */ if ( $post->ID === get_queried_object_id() && ( $this->is_page() || $this->is_single() ) ) { $more = 1; } else if ( $this->is_feed() ) { @@ -4575,9 +4577,11 @@ class WP_Query { $content = str_replace( "\n\n", '', $content ); $content = str_replace( "\n", '', $content ); $content = str_replace( "\n", '', $content ); + // Ignore nextpage at the beginning of the content. if ( 0 === strpos( $content, '' ) ) $content = substr( $content, 15 ); + $pages = explode('', $content); $numpages = count($pages); if ( $numpages > 1 ) @@ -4590,7 +4594,7 @@ class WP_Query { * Fires once the post data has been setup. * * @since 2.8.0 - * @since 4.1.0 Introduced $this parameter. + * @since 4.1.0 Introduced `$this` parameter. * * @param WP_Post &$post The Post object (passed by reference). * @param WP_Query &$this The current Query object (passed by reference).