Skip to content

Commit

Permalink
Fix double slashing on /index.php//taxonomy/term/ links. Props Scribu…
Browse files Browse the repository at this point in the history
…. Fixes #12508. Also Fixes #10445

git-svn-id: https://develop.svn.wordpress.org/trunk@13597 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
dd32 committed Mar 6, 2010
1 parent fce63de commit ce6ac1f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions wp-includes/taxonomy.php
Expand Up @@ -233,14 +233,12 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
}

if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) {
if ( !is_array($args['rewrite']) )
$args['rewrite'] = array();
if ( !isset($args['rewrite']['slug']) )
$args['rewrite']['slug'] = sanitize_title_with_dashes($taxonomy);
if ( !isset($args['rewrite']['with_front']) )
$args['rewrite']['with_front'] = true;
$wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=$term");
$wp_rewrite->add_permastruct($taxonomy, "/{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
$args['rewrite'] = wp_parse_args($args['rewrite'], array(
'slug' => sanitize_title_with_dashes($taxonomy),
'with_front' => true,
));
$wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
$wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
}

if ( is_null($args['show_ui']) )
Expand Down

0 comments on commit ce6ac1f

Please sign in to comment.