mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Posts, Post Types: Avoid a PHP warning when the_content() is called outside of the loop.
Fixes #47824. git-svn-id: https://develop.svn.wordpress.org/trunk@46079 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -282,7 +282,7 @@ function get_the_content( $more_link_text = null, $strip_teaser = false, $post =
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( null === $post ) {
|
||||
if ( null === $post && in_the_loop() ) {
|
||||
$elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' );
|
||||
} else {
|
||||
$elements = generate_postdata( $_post );
|
||||
|
||||
Reference in New Issue
Block a user