Make WordPress Core


Ignore:
Timestamp:
03/06/2010 03:43:23 AM (15 years ago)
Author:
dd32
Message:

Fix double slashing on /index.phptaxonomy/term/ links. Props Scribu. Fixes #12508. Also Fixes #10445

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r13491 r13597  
    234234
    235235    if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) {
    236         if ( !is_array($args['rewrite']) )
    237             $args['rewrite'] = array();
    238         if ( !isset($args['rewrite']['slug']) )
    239             $args['rewrite']['slug'] = sanitize_title_with_dashes($taxonomy);
    240         if ( !isset($args['rewrite']['with_front']) )
    241             $args['rewrite']['with_front'] = true;
    242         $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=$term");
    243         $wp_rewrite->add_permastruct($taxonomy, "/{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
     236        $args['rewrite'] = wp_parse_args($args['rewrite'], array(
     237            'slug' => sanitize_title_with_dashes($taxonomy),
     238            'with_front' => true,
     239        ));
     240        $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
     241        $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
    244242    }
    245243
Note: See TracChangeset for help on using the changeset viewer.