mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user