Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 21184)
+++ wp-includes/taxonomy.php	(working copy)
@@ -2233,20 +2233,35 @@
  * @subpackage Taxonomy
  * @since 2.3.0
  * @uses $wpdb
+ * @uses apply_filters() Calls 'pre_wp_unique_term_slug' with empty string and
+ *  all function arguments
+ * @uses apply_filters() Will call the 'wp_unique_term_slug_is_bad_hierarchical_slug'
+ *  filter and pass false and all function arguments
+ * @uses apply_filters() Will call the 'wp_unique_term_slug_is_bad_flat_slug'
+ *  filter and pass false, the potentially modified slug, the term, and the
+ *  original slug.
+ * @uses apply_filters() Will call the 'wp_unique_term_slug' filter and pass
+ *  the resulting unique slug, the term, and the original slug.
  *
  * @param string $slug The string that will be tried for a unique slug
- * @param object $term The term object that the $slug will belong too
+ * @param object $term The term object that the $slug will belong to
  * @return string Will return a true unique slug.
  */
 function wp_unique_term_slug($slug, $term) {
 	global $wpdb;
 
+	$override_slug = apply_filters( 'pre_wp_unique_term_slug', '', $slug, $term );
+	if ( $override_slug )
+		return $override_slug;
+
 	if ( ! term_exists( $slug ) )
 		return $slug;
 
+	$original_slug = $slug;
+
 	// If the taxonomy supports hierarchy and the term has a parent, make the slug unique
 	// by incorporating parent slugs.
-	if ( is_taxonomy_hierarchical($term->taxonomy) && !empty($term->parent) ) {
+	if ( is_taxonomy_hierarchical( $term->taxonomy ) && ! empty( $term->parent ) && ! apply_filters( 'wp_unique_term_slug_is_bad_hierarchical_slug', false, $slug, $term ) ) {
 		$the_parent = $term->parent;
 		while ( ! empty($the_parent) ) {
 			$parent_term = get_term($the_parent, $term->taxonomy);
@@ -2254,7 +2269,7 @@
 				break;
 			$slug .= '-' . $parent_term->slug;
 			if ( ! term_exists( $slug ) )
-				return $slug;
+				return apply_filters( 'wp_unique_term_slug', $slug, $term, $original_slug );
 
 			if ( empty($parent_term->parent) )
 				break;
@@ -2268,7 +2283,7 @@
 	else
 		$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug );
 
-	if ( $wpdb->get_var( $query ) ) {
+	if ( $wpdb->get_var( $query ) || apply_filters( 'wp_unique_term_slug_is_bad_flat_slug', false, $slug, $term, $original_slug ) ) {
 		$num = 2;
 		do {
 			$alt_slug = $slug . "-$num";
@@ -2278,7 +2293,7 @@
 		$slug = $alt_slug;
 	}
 
-	return $slug;
+	return apply_filters( 'wp_unique_term_slug', $slug, $term, $original_slug );
 }
 
 /**
