From fca5b63772fce415ab9cd05c026233d6ec768a0a Mon Sep 17 00:00:00 2001 From: nacin Date: Sat, 27 Mar 2010 07:56:54 +0000 Subject: [PATCH] Bail in wp_unique_term_slug if the slug is unique and we don't need to come up with a new one. fixes #10712. git-svn-id: http://svn.automattic.com/wordpress/trunk@13845 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index a6d4652d8..acb35c3b6 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1719,6 +1719,9 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { function wp_unique_term_slug($slug, $term) { global $wpdb; + if ( ! is_term( $slug ) ) + return $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) ) {