#15059 closed defect (bug) (fixed)
Fix for "Undefined property: WP_Query::$post" in register_globals
| Reported by: | chrisjean | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | General | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [15750]) Avoid Notice if the query doesn't have a post set e.g. on a 404 . Fixes #15059 props chrisbliss18.