only append parent term slug until unique slug found, see #10712

git-svn-id: https://develop.svn.wordpress.org/trunk@14234 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ron Rennick 2010-04-25 15:25:00 +00:00
parent a5c4bcabe0
commit be6734dd06
1 changed files with 4 additions and 1 deletions

View File

@ -1731,7 +1731,10 @@ function wp_unique_term_slug($slug, $term) {
$parent_term = get_term($the_parent, $term->taxonomy);
if ( is_wp_error($parent_term) || empty($parent_term) )
break;
$slug .= '-' . $parent_term->slug;
$slug .= '-' . $parent_term->slug;
if ( ! is_term( $slug ) )
return $slug;
if ( empty($parent_term->parent) )
break;
$the_parent = $parent_term->parent;