WordPress.org

Make WordPress Core

Ticket #47824: 47824.diff

File 47824.diff, 461 bytes (added by SergeyBiryukov, 7 weeks ago)
  • src/wp-includes/post-template.php

     
    276276                return '';
    277277        }
    278278
    279         if ( null === $post ) {
     279        if ( null === $post && in_the_loop() ) {
    280280                $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' );
    281281        } else {
    282282                $elements = generate_postdata( $_post );