[wp-trac] [WordPress Trac] #55400: PHP Warning: Attempt to read property "post_type"

WordPress Trac noreply at wordpress.org
Wed Mar 16 12:18:36 UTC 2022


#55400: PHP Warning:  Attempt to read property "post_type"
-------------------------------------------+------------------------------
 Reporter:  stcn                           |       Owner:  (none)
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  General                        |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  reporter-feedback needs-patch  |     Focuses:
-------------------------------------------+------------------------------
Changes (by azouamauriac):

 * keywords:  reporter-feedback => reporter-feedback needs-patch


Comment:

 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 returns ''null'' I
 guess it was caused that.

 [[Image(https://prnt.sc/YvmBGT785JaJ)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55400#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list