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: http://svn.automattic.com/wordpress/trunk@15690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin
2010-10-03 07:29:44 +00:00
parent 054e18cb05
commit c6ff4fbaa9
3 changed files with 10 additions and 22 deletions

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.
*