[wp-trac] [WordPress Trac] #56287: Handle PHP Notice when get_post_type_object() returns null

WordPress Trac noreply at wordpress.org
Tue Jul 26 14:41:41 UTC 2022


#56287: Handle PHP Notice when get_post_type_object() returns null
--------------------------+-----------------------------
 Reporter:  sean212       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:
 Severity:  normal        |   Keywords:  php8
  Focuses:                |
--------------------------+-----------------------------
 When get_post_type_object() is called inside is_post_type_archive() it can
 return null and will potentially throw a PHP notice.

 Relates to #29660 but isn't specific to get_queried_object() so I figured
 it might be worthwhile to track separately.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56287>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list