WordPress.org

Make WordPress Core

Changeset 15750


Ignore:
Timestamp:
10/07/2010 09:23:50 PM (9 years ago)
Author:
westi
Message:

Avoid Notice if the query doesn't have a post set e.g. on a 404 . Fixes #15059 props chrisbliss18.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r15737 r15750  
    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
Note: See TracChangeset for help on using the changeset viewer.