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

WordPress Trac noreply at wordpress.org
Wed Aug 3 18:53:34 UTC 2022


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

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests needs-
     testing
 * owner:  joehoyle => (none)
 * milestone:   => 6.1


Comment:

 Looks like this still exists today.

 Since it has not had any activity in 6+ years, I'm resetting the `Owned
 by` field. If anyone that has participated in the past would like to
 reclaim it, please feel free.

 I've refreshed [attachment:"19954.diff"] to apply to the current `trunk`
 and adjusted the approach slightly. The coverage of this area in
 `wp_insert_post()` is [https://app.codecov.io/gh/WordPress/wordpress-
 develop/blob/trunk/src/wp-includes/post.php actually quite good]. With the
 added tests, I think this is a pretty safe change to make, but would still
 like some additional testing and sanity checking.

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


More information about the wp-trac mailing list