[wp-trac] [WordPress Trac] #27015: WP_Query::get_queried_object() does not always work in 'pre_get_posts'
WordPress Trac
noreply at wordpress.org
Thu Feb 20 22:53:17 UTC 2014
#27015: WP_Query::get_queried_object() does not always work in 'pre_get_posts'
--------------------------+------------------------------
Reporter: bcworkz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 3.8
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by bcworkz):
Replying to [comment:2 tivnet]:
> To reproduce the error that
[https://core.trac.wordpress.org/attachment/ticket/27015/is_category.patch
my patch] fixes:
> Call `is_category('example')` within a `pre_get_posts` action, and go to
a non-existing URL.
Are you sure this is the correct place for this patch? This ticket is for
`get_queried_object()` issues. You are addressing issues with
`is_category()`. They are obviously related, but I believe yours is a
separate issue. This ticket is trying to resolve many cases where
`get_queried_object()` inappropriately returns `NULL`. Even if this issue
is fixed, there will be cases where `NULL` is properly returned, such as
your condition.
To clarify reproducing your error, people need to make a non-existing
category request, any non-existing URL will not necessarily do it. And
have `WP_DEBUG` set to `true` of course.
Replying to [comment:3 SergeyBiryukov]:
>Description modified (diff)
Thx Sergey! Frustrating seeing one's errors and not being able to do
anything about it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27015#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list