WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/07/2019 02:32:23 PM (6 weeks ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Avoid a PHP warning when the_content() is called outside of the loop.

Fixes #47824.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r45935 r46079  
    283283    }
    284284
    285     if ( null === $post ) {
     285    if ( null === $post && in_the_loop() ) {
    286286        $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' );
    287287    } else {
Note: See TracChangeset for help on using the changeset viewer.