Ticket #47824: 47824.3.diff
| File 47824.3.diff, 1.7 KB (added by , 7 years ago) |
|---|
-
src/wp-includes/post-template.php
261 261 * @since 0.71 262 262 * @since 5.2.0 Added the `$post` parameter. 263 263 * 264 * @global int $page Page number of a single post/page.265 * @global int $more Boolean indicator for whether single post/page is being viewed.266 * @global bool $preview Whether post/page is in preview mode.267 * @global array $pages Array of all pages in post/page. Each array element contains268 * part of the content separated by the `<!--nextpage-->` tag.269 * @global int $multipage Boolean indicator for whether multiple pages are in play.270 *271 264 * @param string $more_link_text Optional. Content for when there is more text. 272 265 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 273 266 * @param WP_Post|object|int $post Optional. WP_Post instance or Post ID/object. Default is null. … … 274 267 * @return string 275 268 */ 276 269 function get_the_content( $more_link_text = null, $strip_teaser = false, $post = null ) { 277 global $page, $more, $preview, $pages, $multipage;278 279 270 $_post = get_post( $post ); 280 271 281 272 if ( ! ( $_post instanceof WP_Post ) ) { … … 282 273 return ''; 283 274 } 284 275 285 if ( null === $post ) { 286 $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' ); 287 } else { 288 $elements = generate_postdata( $_post ); 289 } 276 $elements = generate_postdata( $_post ); 290 277 291 278 if ( null === $more_link_text ) { 292 279 $more_link_text = sprintf(