Changeset 48114
- Timestamp:
- 06/21/2020 10:34:35 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r48104 r48114 4276 4276 4277 4277 /** 4278 * Fires once the post data has been set up.4278 * Fires once the post data has been set up. 4279 4279 * 4280 4280 * @since 2.8.0 -
trunk/src/wp-includes/post-template.php
r48060 r48114 283 283 } 284 284 285 if ( null === $post ) { 285 // Use the globals if the $post parameter was not specified, 286 // but only after they have been set up in setup_postdata(). 287 if ( null === $post && did_action( 'the_post' ) ) { 286 288 $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' ); 287 289 } else { -
trunk/tests/phpunit/tests/post/getTheContent.php
r46586 r48114 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.