Ticket #47824: 47824.2.diff
File 47824.2.diff, 1.0 KB (added by , 4 years ago) |
---|
-
src/wp-includes/post-template.php
276 276 return ''; 277 277 } 278 278 279 if ( null === $post ) {279 if ( null === $post && in_the_loop() ) { 280 280 $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' ); 281 281 } else { 282 282 $elements = generate_postdata( $_post ); -
tests/phpunit/tests/post/getTheContent.php
75 75 76 76 $this->assertSame( 'Bang', $found ); 77 77 } 78 79 /** 80 * @ticket 47824 81 */ 82 public function test_should_fall_back_to_post_global_outside_of_the_loop() { 83 $GLOBALS['post'] = self::factory()->post->create( array( 'post_content' => 'Foo' ) ); 84 85 $this->assertSame( 'Foo', get_the_content() ); 86 } 78 87 }