[wp-trac] [WordPress Trac] #19954: wp_insert_post should look if default category is nessesary

WordPress Trac noreply at wordpress.org
Fri Jun 24 10:32:08 UTC 2016


#19954: wp_insert_post should look if default category is nessesary
--------------------------------------+-----------------------------
 Reporter:  markoheijnen              |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  Posts, Post Types         |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by leewillis77):

 * keywords:  has-patch needs-refresh => has-patch has-unit-tests


Comment:

 Hi;

 I just hit this bug in a project. The issue is that if you call
 wp_insert_post() with an existing post ID, and do not supply post_category
 then any categories assigned to the post will be removed and replaced with
 the default category.

 Patch with unit tests attached.

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


More information about the wp-trac mailing list