Opened 10 years ago
Closed 10 years ago
#1731 closed defect (bug) (fixed)
Fix notice for function wporg_is_handbook on single post pages
| Reported by: | keesiemeijer | Owned by: | coffee2code |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Handbooks | Keywords: | has-patch |
| Cc: |
Description
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.
Attachments (1)
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Fix notice