diff options
Diffstat (limited to 'wp-includes')
-rw-r--r-- | wp-includes/taxonomy.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 57b7b2d..3bc1429 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1034,8 +1034,8 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { // expected_slashed ($name) $name = stripslashes($name); - // slug is always santized name in WordPress MU - $slug = sanitize_title($name); + if ( empty($slug) ) + $slug = sanitize_title($name); $term_group = 0; if ( $alias_of ) { @@ -1229,6 +1229,7 @@ function wp_update_term( $term, $taxonomy, $args = array() ) { return new WP_Error('invalid_taxonomy', __('Invalid taxonomy')); $term_id = (int) $term; + $args = apply_filters( 'pre_update_term', $term, $taxonomy, $args ); // First, get all of the original args $term = get_term ($term_id, $taxonomy, ARRAY_A); @@ -1244,9 +1245,11 @@ function wp_update_term( $term, $taxonomy, $args = array() ) { $args = sanitize_term($args, $taxonomy, 'db'); extract($args, EXTR_SKIP); - // slug is always santized name in WordPress MU - $empty_slug = true; - $slug = sanitize_title($name); + $empty_slug = false; + if ( empty($slug) ) { + $empty_slug = true; + $slug = sanitize_title($name); + } if ( $alias_of ) { $alias = $wpdb->get_row( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $alias_of) ); |