Ticket #17174: 16627-17174.diff
File 16627-17174.diff, 1.2 KB (added by , 14 years ago) |
---|
-
wp-includes/canonical.php
164 164 $redirect['query'] = remove_query_arg( array( 'term', 'taxonomy'), $redirect['query']); 165 165 } 166 166 } 167 168 $tax_obj = get_taxonomy( $obj->taxonomy ); 169 $tax_query_vars = array_diff( array_keys( $wp_query->query ), array_keys( $_GET ), array( 'taxonomy', 'term', $tax_obj->query_var ) ); 170 167 171 $tax_url = parse_url($tax_url); 168 if ( ! empty($tax_url['query']) ) { // Custom taxonomies may only be accessable via ?taxonomy=..&term=.. 172 if ( ! empty($tax_query_vars) ) { 173 //The request was for a 174 foreach ( array( 'taxonomy', 'term', $tax_obj->query_var ) as $qv ) { 175 if ( !empty($wp_query->query[$qv]) ) 176 $redirect['query'] = add_query_arg(array($qv => $wp_query->query[$qv]), $redirect['query']); 177 } 178 179 } elseif ( ! empty($tax_url['query']) ) { // Custom taxonomies may only be accessable via ?taxonomy=..&term=.. 169 180 parse_str($tax_url['query'], $query_vars); 170 181 $redirect['query'] = add_query_arg($query_vars, $redirect['query']); 171 182 } else { // Taxonomy is accessable via a "pretty-URL"