[wp-trac] [WordPress Trac] #19954: wp_insert_post overwrites categories when updating existing post

WordPress Trac noreply at wordpress.org
Thu Aug 11 19:58:35 UTC 2022


#19954: wp_insert_post overwrites categories when updating existing post
---------------------------------------------+--------------------------
 Reporter:  markoheijnen                     |       Owner:  johnbillion
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  6.1
Component:  Posts, Post Types                |     Version:
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+--------------------------
Changes (by johnbillion):

 * owner:  (none) => johnbillion
 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"53883" 53883]:
 {{{
 #!CommitTicketReference repository="" revision="53883"
 Posts, Post Types: Prevent categories from being overwritten when updating
 a post using `wp_insert_post()`.

 This prevents existing category relationships being overridden with the
 default category when none is provided in the post data.

 Props markoheijnen, leewillis77, desrosj

 Fixes #19954
 }}}

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


More information about the wp-trac mailing list