Opened 11 years ago
Closed 11 years ago
#28412 closed defect (bug) (fixed)
get_queried_object_id() method in pre_get_posts
Reported by: | wpsmith | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Query | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
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.
11 years ago
#3
@
11 years ago
- Focuses administration template multisite performance removed
- Milestone changed from Awaiting Review to 4.0
#4
@
11 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.
query.php patch