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:
parent
84887d6386
commit
98c3888a06
|
@ -1731,7 +1731,10 @@ function wp_unique_term_slug($slug, $term) {
|
||||||
$parent_term = get_term($the_parent, $term->taxonomy);
|
$parent_term = get_term($the_parent, $term->taxonomy);
|
||||||
if ( is_wp_error($parent_term) || empty($parent_term) )
|
if ( is_wp_error($parent_term) || empty($parent_term) )
|
||||||
break;
|
break;
|
||||||
$slug .= '-' . $parent_term->slug;
|
$slug .= '-' . $parent_term->slug;
|
||||||
|
if ( ! is_term( $slug ) )
|
||||||
|
return $slug;
|
||||||
|
|
||||||
if ( empty($parent_term->parent) )
|
if ( empty($parent_term->parent) )
|
||||||
break;
|
break;
|
||||||
$the_parent = $parent_term->parent;
|
$the_parent = $parent_term->parent;
|
||||||
|
|
Loading…
Reference in New Issue