Prevent double index.php preprend on PATHINFO custom taxonomy permalinks. Proper use of with_front. props greuben. fixes #16918. fixes #16622. see #15813. see #12659. For trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@17512 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2011-03-09 05:18:45 +00:00
parent 652ac55480
commit c15c6f2b23
2 changed files with 6 additions and 4 deletions

View File

@ -15,6 +15,8 @@
* Creates the initial taxonomies when 'init' action is fired. * Creates the initial taxonomies when 'init' action is fired.
*/ */
function create_initial_taxonomies() { function create_initial_taxonomies() {
global $wp_rewrite;
register_taxonomy( 'category', 'post', array( register_taxonomy( 'category', 'post', array(
'hierarchical' => true, 'hierarchical' => true,
'update_count_callback' => '_update_post_term_count', 'update_count_callback' => '_update_post_term_count',
@ -22,7 +24,7 @@ function create_initial_taxonomies() {
'rewrite' => did_action( 'init' ) ? array( 'rewrite' => did_action( 'init' ) ? array(
'hierarchical' => true, 'hierarchical' => true,
'slug' => get_option('category_base') ? get_option('category_base') : 'category', 'slug' => get_option('category_base') ? get_option('category_base') : 'category',
'with_front' => false) : false, 'with_front' => ( get_option('category_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,
'public' => true, 'public' => true,
'show_ui' => true, 'show_ui' => true,
'_builtin' => true, '_builtin' => true,
@ -34,7 +36,7 @@ function create_initial_taxonomies() {
'query_var' => 'tag', 'query_var' => 'tag',
'rewrite' => did_action( 'init' ) ? array( 'rewrite' => did_action( 'init' ) ? array(
'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag', 'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag',
'with_front' => false) : false, 'with_front' => ( get_option('category_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,
'public' => true, 'public' => true,
'show_ui' => true, 'show_ui' => true,
'_builtin' => true, '_builtin' => true,
@ -329,7 +331,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
$tag = '([^/]+)'; $tag = '([^/]+)';
$wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
$wp_rewrite->add_permastruct($taxonomy, "{$wp_rewrite->root}{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
} }
if ( is_null($args['show_ui']) ) if ( is_null($args['show_ui']) )

View File

@ -29,7 +29,7 @@ $wp_version = '3.2-bleeding';
* *
* @global int $wp_db_version * @global int $wp_db_version
*/ */
$wp_db_version = 17056; $wp_db_version = 17510;
/** /**
* Holds the TinyMCE version * Holds the TinyMCE version