WordPress.org

Make WordPress Core

Changeset 12791


Ignore:
Timestamp:
01/21/10 22:25:16 (4 years ago)
Author:
ryan
Message:

Add flag to taxonomy registration allowing permalinks to be prepended with front, or not. Props prettyboymp. fixes #11449

File:
1 edited

Legend:

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

    r12733 r12791  
    186186        if ( !isset($args['rewrite']['slug']) ) 
    187187            $args['rewrite']['slug'] = sanitize_title_with_dashes($taxonomy); 
     188        if ( !isset($args['rewrite']['with_front']) ) 
     189            $args['rewrite']['with_front'] = true; 
    188190        $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=$term"); 
    189         $wp_rewrite->add_permastruct($taxonomy, "/{$args['rewrite']['slug']}/%$taxonomy%"); 
     191        $wp_rewrite->add_permastruct($taxonomy, "/{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); 
    190192    } 
    191193 
Note: See TracChangeset for help on using the changeset viewer.