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

git-svn-id: http://svn.automattic.com/wordpress/trunk@14234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-04-25 15:25:00 +00:00
parent 84887d6386
commit 98c3888a06
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;