diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
index 7a278323af..6d7d06121d 100644
a
|
b
|
function wp_delete_term( $term, $taxonomy, $args = array() ) { |
1804 | 1804 | |
1805 | 1805 | $defaults = array(); |
1806 | 1806 | |
1807 | | if ( 'category' == $taxonomy ) { |
1808 | | $defaults['default'] = get_option( 'default_category' ); |
1809 | | if ( $defaults['default'] == $term ) { |
1810 | | return 0; // Don't delete the default category |
1811 | | } |
| 1807 | $default_term = get_option( "default_{$taxonomy}" ); |
| 1808 | |
| 1809 | if ( $default_term && $default_term == $term ) { |
| 1810 | return 0; // Don't delete the default category |
| 1811 | } else if ( $default_term ) { |
| 1812 | $defaults['default'] = $default_term; |
1812 | 1813 | } |
1813 | 1814 | |
1814 | 1815 | $args = wp_parse_args( $args, $defaults ); |