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

WordPress Trac noreply at wordpress.org
Mon Oct 10 23:01:23 UTC 2022


#56287: Handle PHP Notice when get_post_type_object() returns null in
is_post_type_archive()
-------------------------------------------+-----------------------
 Reporter:  sean212                        |       Owner:  audrasjb
     Type:  defect (bug)                   |      Status:  closed
 Priority:  normal                         |   Milestone:  6.1
Component:  Query                          |     Version:
 Severity:  normal                         |  Resolution:  fixed
 Keywords:  php8 has-patch has-unit-tests  |     Focuses:
-------------------------------------------+-----------------------
Changes (by audrasjb):

 * owner:  (none) => audrasjb
 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54464" 54464]:
 {{{
 #!CommitTicketReference repository="" revision="54464"
 Query: Prevent PHP notice when `get_post_type_object()` returns `null` in
 `is_post_type_archive()`.

 This changeset avoids potential PHP notices caused by
 `get_post_type_object()` returning `null` when called inside
 `is_post_type_archive()`.

 Props sean212, costdev.
 Fixes #56287.
 }}}

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


More information about the wp-trac mailing list