[wp-trac] [WordPress Trac] #20046: Unnecessary default category code remains in wp_insert_attachment

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 15 00:13:31 UTC 2012


#20046: Unnecessary default category code remains in wp_insert_attachment
--------------------------+-----------------------------
 Reporter:  jeremyfelt    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:
 Severity:  trivial       |   Keywords:  has-patch
--------------------------+-----------------------------
 After the default arguments are set, post_type is forced to 'attachment',
 negating any requirement for default categories to be added.

 Quick patch removes:

 (1) The test performed for 'post' post_type in order to assign default
 categories to an array. Result was always an empty array.

 (2) The call to wp_set_post_categories with this empty array, which sends
 the post_ID through a bunch of taxonomy related code that passes over it.
 This does cause the action 'set_object_terms' to be skipped, which should
 be okay as attachments don't have terms.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20046>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list