Opened 12 years ago
Closed 12 years ago
#28412 closed defect (bug) (fixed)
get_queried_object_id() method in pre_get_posts
| Reported by: | wpsmith | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.0 |
| Component: | Query | Version: | 4.0 |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: | Focuses: |
Description
When using $wp_query->get_queried_object_id() within the pre_get_posts hook results in an error:
Notice: Undefined property: WP_Query::$post in C:\xampp\htdocs\wp\wp-includes\query.php on line 3700
Here is a simple test:
https://gist.github.com/wpsmith/0c5a1d497eb5738309f6
Attachments (2)
Change History (7)
This ticket was mentioned in IRC in #wordpress-dev by wpsmith. View the logs.
12 years ago
#3
@
12 years ago
- Focuses administration template multisite performance removed
- Milestone Awaiting Review → 4.0
#4
@
12 years ago
An alternative approach in 28412.diff: since we're checking for null with is_null(), let's actually set it to null during init.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
query.php patch