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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user