Changeset 13091 for trunk/wp-includes/canonical.php
- Timestamp:
- 02/13/2010 06:17:59 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/canonical.php
r13072 r13091 140 140 } 141 141 142 // redirect sub-terms of taxonomies to their correct urls 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'); 150 } 151 if ( $tax_url = get_term_link($slug, $taxonomy) ) { 152 $tax_url = parse_url($tax_url); 153 $redirect['path'] = $tax_url['path']; 154 } 155 } 156 142 157 // paging and feeds 143 158 if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) { … … 258 273 // Strip multiple slashes out of the URL 259 274 if ( strpos($original['path'], '//') > -1 ) 260 $redirect['path'] = preg_replace('|/+|', '/', $ original['path']);275 $redirect['path'] = preg_replace('|/+|', '/', $redirect['path']); 261 276 262 277 // Always trailing slash the Front Page URL
Note: See TracChangeset
for help on using the changeset viewer.