diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index a1582277e3..06d531c39a 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -4275,7 +4275,7 @@ class WP_Query { $numpages = $elements['numpages']; /** - * Fires once the post data has been setup. + * Fires once the post data has been set up. * * @since 2.8.0 * @since 4.1.0 Introduced `$this` parameter. diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 164001e716..c2ee232649 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -282,7 +282,9 @@ function get_the_content( $more_link_text = null, $strip_teaser = false, $post = return ''; } - if ( null === $post ) { + // Use the globals if the $post parameter was not specified, + // but only after they have been set up in setup_postdata(). + if ( null === $post && did_action( 'the_post' ) ) { $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' ); } else { $elements = generate_postdata( $_post ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 796d31f04a..79942da0b2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48113'; +$wp_version = '5.5-alpha-48114'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.