Unnecessary default category code remains in wp_insert_attachment
|Reported by:||jeremyfelt||Owned by:|
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.
Change History (9)
21 months ago
- Keywords reporter-feedback added
- Version set to 2.0