[wp-trac] [WordPress Trac] #60947: calling get_post_type_object in wp-admin/includes/post.php may return null

WordPress Trac noreply at wordpress.org
Tue Sep 3 22:41:22 UTC 2024


#60947: calling get_post_type_object in wp-admin/includes/post.php may return null
-------------------------------+-----------------------------
 Reporter:  pcarvalho          |       Owner:  SergeyBiryukov
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  6.7
Component:  Posts, Post Types  |     Version:  3.6
 Severity:  minor              |  Resolution:  fixed
 Keywords:  has-patch          |     Focuses:
-------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58983" 58983]:
 {{{
 #!CommitTicketReference repository="" revision="58983"
 Posts, Post Types: Check if the post type exists in
 `_admin_notice_post_locked()`.

 This adds a guard to verify the result of `get_post_type_object()` before
 retrieving the `all_items` label, as the function returns `null` if the
 post type does not exist.

 Follow-up to [24527].

 Props pcarvalho, akshat280, mukesh27, SergeyBiryukov.
 Fixes #60947.
 }}}

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


More information about the wp-trac mailing list