From b9457ce8fffffd1f41a462c89123f4d516c5786a Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 21 Jan 2010 22:25:16 +0000 Subject: [PATCH] Add flag to taxonomy registration allowing permalinks to be prepended with front, or not. Props prettyboymp. fixes #11449 git-svn-id: https://develop.svn.wordpress.org/trunk@12791 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/taxonomy.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 873c5a3ac2..4f644fea9a 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -185,8 +185,10 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { $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%"); + $wp_rewrite->add_permastruct($taxonomy, "/{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); } $args['name'] = $taxonomy;