Ticket #20783: 20783.diff
| File 20783.diff, 1.2 KB (added by , 14 years ago) |
|---|
-
wp-includes/taxonomy.php
2233 2233 * @subpackage Taxonomy 2234 2234 * @since 2.3.0 2235 2235 * @uses $wpdb 2236 * @uses apply_filters() Will call the 'wp_unique_term_slug' filter and pass 2237 * the resulting unique slug, the term, and the original slug. 2236 2238 * 2237 2239 * @param string $slug The string that will be tried for a unique slug 2238 * @param object $term The term object that the $slug will belong to o2240 * @param object $term The term object that the $slug will belong to 2239 2241 * @return string Will return a true unique slug. 2240 2242 */ 2241 2243 function wp_unique_term_slug($slug, $term) { … … 2244 2246 if ( ! term_exists( $slug ) ) 2245 2247 return $slug; 2246 2248 2249 $original_slug = $slug; 2250 2247 2251 // If the taxonomy supports hierarchy and the term has a parent, make the slug unique 2248 2252 // by incorporating parent slugs. 2249 2253 if ( is_taxonomy_hierarchical($term->taxonomy) && !empty($term->parent) ) { … … 2278 2282 $slug = $alt_slug; 2279 2283 } 2280 2284 2281 return $slug;2285 return apply_filters( 'wp_unique_term_slug', $slug, $term, $original_slug ); 2282 2286 } 2283 2287 2284 2288 /**