[wp-meta] [Making WordPress.org] #1731: Fix notice for function wporg_is_handbook on single post pages
Making WordPress.org
noreply at wordpress.org
Wed May 25 14:39:29 UTC 2016
#1731: Fix notice for function wporg_is_handbook on single post pages
--------------------------+-----------------------
Reporter: keesiemeijer | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Handbooks | Keywords: has-patch
--------------------------+-----------------------
The function `wporg_is_handbook()` displays this notice on single post
pages when used before the queried object is set (as in the pre_get_posts
action).
Notice: Trying to get property of non-object in /srv/www/wp-
reference/public/wp-includes/query.php on line 4654
This notice originates from `WP_Query::is_singular()` where
`get_queried_object()` is used.
To fix this warning there needs to be a check if the queried object is
set. If it's not set, use the post type query var from the current query
to determine if it's a handbook page.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/1731>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list