Fix for "Undefined property: WP_Query::$post" in register_globals
|Reported by:||chrisjean||Owned by:|
The register_globals function (wp-includes/classes.php) has an unchecked property reference. This causes the following warning to be generated on post type listings when the post type has no entries:
Notice: Undefined property: WP_Query::$post in ABSPATH/wp-includes/classes.php on line 443
The attached patch fixes removes the warning with an isset check that assigns a value of null if $wp_query->post isn't set. This is the same result as assigning the undefined value without the warning.