[wp-trac] [WordPress Trac] #55877: wp_insert_post() should check that a post type exists before using it

WordPress Trac noreply at wordpress.org
Sun Jul 24 13:24:59 UTC 2022


#55877: wp_insert_post() should check that a post type exists before using it
----------------------------------------+-----------------------------
 Reporter:  Chouby                      |       Owner:  SergeyBiryukov
     Type:  defect (bug)                |      Status:  closed
 Priority:  normal                      |   Milestone:  6.1
Component:  Posts, Post Types           |     Version:  5.1
 Severity:  normal                      |  Resolution:  fixed
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

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


Comment:

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

 This avoids an `Attempt to read property "cap" on null` PHP warning when
 checking an unregistered post type's `publish_posts` capability to
 disallow contributors setting the post slug for pending posts.

 Follow-up to [9055], [42380].

 Props Chouby, mukesh27, rafiahmedd, SergeyBiryukov.
 Fixes #55877.
 }}}

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


More information about the wp-trac mailing list