WordPress.org

Make WordPress Core

Ticket #15059: fix-undefined-property-post.diff

File fix-undefined-property-post.diff, 476 bytes (added by chrisbliss18, 5 years ago)
  • wp-includes/classes.php

    diff --git a/wp-includes/classes.php b/wp-includes/classes.php
    index c0bbd36..004d4c8 100644
    a b class WP { 
    440440 
    441441                $GLOBALS['query_string'] = $this->query_string; 
    442442                $GLOBALS['posts'] = & $wp_query->posts; 
    443                 $GLOBALS['post'] = $wp_query->post; 
     443                $GLOBALS['post'] = (isset($wp_query->post)) ? $wp_query->post : null; 
    444444                $GLOBALS['request'] = $wp_query->request; 
    445445 
    446446                if ( is_single() || is_page() ) {