Opened 13 years ago
Last modified 5 years ago
#18448 assigned defect (bug)
wp_insert_category() is Not Properly Abstracted
Reported by: | miqrogroove | Owned by: | chriscct7 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Taxonomy | Keywords: | needs-testing has-patch needs-refresh |
Focuses: | Cc: |
Description
If you look in http://core.trac.wordpress.org/browser/trunk/wp-admin/includes/taxonomy.php there is still a note that says "The 'taxonomy' key was added in 3.0.0."
However, this function calls category_exists() and cat_is_ancestor_of(), which never recognized the taxonomy argument.
Attachments (1)
Change History (8)
#2
@
13 years ago
It gets used in a few spots, but I imagine it should be consolidated into wp_insert_term().
#4
@
13 years ago
- Keywords needs-testing has-patch added; needs-patch removed
The patch replaces all calls to wp_insert_category with calls to corresponding term functions. wp_insert_category, however, had $wp_error argument, that was used to suppress returning WP_Error, so I added it to wp_insert_term and wp_update_term functions. Any opinions on this approach?
P.S. First patch. =)
#5
@
11 years ago
- Keywords needs-refresh added
The patch has a lot of bizarre whitespace - please refresh with the WP Coding Standards in mind
Perhaps more to the point, in edit-tags.php function wp_insert_term() is called rather than wp_insert_category(). It may have been the original intention to deprecate wp_insert_category() in favor of the proper logic. Is this function still being used in core?