Have wp_delete_category wrap wp_delete_term. Move wp_delete_category into wp-includes scope for consistency. fixes #15008, props blepoxp.

git-svn-id: https://develop.svn.wordpress.org/trunk@15690 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-10-03 07:29:44 +00:00
parent 6fd30d36ea
commit 6d07d415ec
3 changed files with 10 additions and 22 deletions
-19
View File
@@ -79,25 +79,6 @@ function wp_create_categories($categories, $post_id = '') {
return $cat_ids;
}
/**
* Deletes one existing category.
*
* @since 2.0.0
*
* @param int $cat_ID
* @return mixed Returns true if completes delete action; false if term doesnt exist; Zero on attempted deletion of default Category; WP_Error object is also a possibility.
*/
function wp_delete_category($cat_ID) {
$cat_ID = (int) $cat_ID;
$default = get_option('default_category');
// Don't delete the default cat
if ( $cat_ID == $default )
return 0;
return wp_delete_term($cat_ID, 'category', array('default' => $default));
}
/**
* Updates an existing Category or creates a new Category.
*