#26775 closed defect (bug) (fixed)
Fatal error in wp_reset_postdata()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.8.1 | Priority: | normal |
| Severity: | normal | Version: | 3.7 |
| Component: | Query | Keywords: | has-patch needs-unit-tests fixed-major |
| Focuses: | Cc: |
Description
[25601] introduced a fatal error when calling wp_reset_query() or wp_reset_postdata() without a valid $wp_query global:
Fatal error: Call to a member function reset_postdata() on a non-object in wp-includes/query.php on line 118
We should probably add a _doing_it_wrong() message in there, but at least let's fix the fatal error.
Attachments (1)
Change History (8)
Note: See
TracTickets for help on using
tickets.
26775.patch uses a basic
isset()check, like the ones we already have for template tags:tags/3.8/src/wp-includes/query.php#L139