Opened 5 years ago
Closed 5 years ago
#55400 closed defect (bug) (duplicate)
PHP Warning: Attempt to read property "post_type"
| Reported by: | stcn | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Hi,
I get this error:
PHP Warning: Attempt to read property "post_type" on null in /public_html/wp-includes/class-wp-query.php on line 4273
what is the problem? how can it be solved?
Thanks!
Attachments (1)
Change History (7)
#2
@
5 years ago
- Keywords needs-patch added
Hi there and welcome to trac!
It seems like we need some if statement in WP_Query::is_singular at line 4292 since WP_Query::get_queried_object can return null I guess it was caused that.
#3
follow-up:
↓ 4
@
5 years ago
- Keywords reporter-feedback removed
Oh nice catch @azouamauriac. Wanna propose a patch for this issue?
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hello and welcome to WordPress Core Trac @stcn,
Could you please provide more information to help contextualize the issue?
Where does it happen? Could you provide a screenshot? Any particular action on you side? Does it occurs with a default theme and no plugin activated?
Thank you