Opened 2 years ago
Closed 2 years ago
#55400 closed defect (bug) (duplicate)
PHP Warning: Attempt to read property "post_type"
Reported by: | stcn | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Query | Keywords: | has-patch |
Focuses: | Cc: |
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
@
2 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
@
2 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.
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