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
+8 -1
View File
@@ -1455,10 +1455,17 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) {
$tt_id = $ids['term_taxonomy_id'];
$defaults = array();
if ( 'category' == $taxonomy ) {
$defaults['default'] = get_option( 'default_category' );
if ( $defaults['default'] == $term )
return 0; // Don't delete the default category
}
$args = wp_parse_args($args, $defaults);
extract($args, EXTR_SKIP);
if ( isset($default) ) {
if ( isset( $default ) ) {
$default = (int) $default;
if ( ! term_exists($default, $taxonomy) )
unset($default);