id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 29852 wp_update_term() should use wp_insert_term() internally boonebgorges "`wp_update_term()` and `wp_insert_term()` have a large amount of overlapping functionality. Things like argument sanitization, `term_exists()` checks, parent and alias_of validation, and even some hook names are shared between the two. Having the logic separate means twice the unit tests and twice the bug fixes for shared functionality. (See #29848 for an example.) This, in turn, has the potential to hold up future refactoring (#5809). As much as possible, the duplicate logic should be pulled out of `wp_update_term()`. Update-specific validation should take place there, and then call `wp_insert_term()` with a `term_id` or `term_taxonomy_id` param. (Suggestions for syntax are welcome.) In `wp_insert_term()`, break out the logic specific to the creation of new terms, and only run it when no existing term ID is passed to the function. Then, choose whether to run `$wpdb->update()` or `$wpdb->insert()` as appropriate." enhancement new normal Taxonomy 2.3 normal needs-patch