Ticket #12245: 12245.2.diff
| File 12245.2.diff, 1014 bytes (added by , 16 years ago) |
|---|
-
wp-includes/canonical.php
141 141 142 142 // redirect sub-terms of taxonomies to their correct urls 143 143 if ( is_category() || is_tax() ) { 144 if ( is_category() ) { 145 $taxonomy = 'category'; 146 $slug = get_query_var('category_name'); 147 } else { 148 $taxonomy = get_query_var('taxonomy'); 149 $slug = get_query_var('term'); 144 if ($term = $wp_query->get_queried_object()) { 145 if ( is_category() ) { 146 $taxonomy = 'category'; 147 } else { 148 $taxonomy = get_query_var('taxonomy'); 149 } 150 if ( $tax_url = get_term_link($term, $taxonomy) ) { 151 $tax_url = parse_url($tax_url); 152 $redirect['path'] = $tax_url['path']; 153 } 150 154 } 151 if ( $tax_url = get_term_link($slug, $taxonomy) ) {152 $tax_url = parse_url($tax_url);153 $redirect['path'] = $tax_url['path'];154 }155 155 } 156 156 157 157 // paging and feeds