[wp-trac] [WordPress Trac] #51292: `wp_publish_post` does not add default category to auto-drafts

WordPress Trac noreply at wordpress.org
Sat Sep 12 23:52:59 UTC 2020


#51292: `wp_publish_post` does not add default category to auto-drafts
--------------------------------------+----------------------------
 Reporter:  peterwilsoncc             |       Owner:  peterwilsoncc
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.6
Component:  Posts, Post Types         |     Version:  2.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------------
Changes (by peterwilsoncc):

 * owner:  (none) => peterwilsoncc
 * status:  new => assigned


Comment:

 In [attachment:"51292.2.diff"]:

 * Adds default terms for taxonomies if required in `wp_publish_post()`
 * Unit tests to ensure default terms are added
 * Unit tests to ensure default terms do not override existing terms
 * Tests to ensure term counts are modified accordingly. It could be argued
 that these tests do not belong on this ticket. Writing these tests for
 another ticket led me to discover this bug so that's why they are
 included.

 **Props due to @TimothyBlynJacobs** for review on pull request.

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


More information about the wp-trac mailing list