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

WordPress Trac noreply at wordpress.org
Wed Aug 3 18:54:09 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                                        |
-------------------------------------------------+-------------------------

Comment (by desrosj):

 Replying to [comment:13 desrosj]:
 > 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`
 [https://github.com/WordPress/wordpress-develop/pull/3057 in a pull
 request] 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:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list