Changeset 46079
- Timestamp:
- 09/07/2019 02:32:23 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r45935 r46079 283 283 } 284 284 285 if ( null === $post ) {285 if ( null === $post && in_the_loop() ) { 286 286 $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' ); 287 287 } else { -
trunk/tests/phpunit/tests/post/getTheContent.php
r44941 r46079 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 }
Note: See TracChangeset
for help on using the changeset viewer.