#15059 closed defect (bug) (fixed)
Fix for "Undefined property: WP_Query::$post" in register_globals
Reported by: | chrisjean | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
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.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
(In [15750]) Avoid Notice if the query doesn't have a post set e.g. on a 404 . Fixes #15059 props chrisbliss18.