- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-includes/canonical.php
r15463 r15708 104 104 if ( $redirect_url = get_permalink(get_query_var('p')) ) 105 105 $redirect['query'] = remove_query_arg(array('p', 'post_type'), $redirect['query']); 106 if ( get_query_var( 'page' ) ) {107 $redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );108 $redirect['query'] = remove_query_arg( 'page', $redirect['query'] );109 }110 106 } elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) { 111 107 if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) … … 181 177 } 182 178 } elseif ( is_single() && strpos($wp_rewrite->permalink_structure, '%category%') !== false ) { 183 $category = get_ term_by('slug', get_query_var('category_name'), 'category');179 $category = get_category_by_path(get_query_var('category_name')); 184 180 $post_terms = wp_get_object_terms($wp_query->get_queried_object_id(), 'category', array('fields' => 'tt_ids')); 185 181 if ( (!$category || is_wp_error($category)) || ( !is_wp_error($post_terms) && !empty($post_terms) && !in_array($category->term_taxonomy_id, $post_terms) ) ) 186 182 $redirect_url = get_permalink($wp_query->get_queried_object_id()); 183 } 184 185 // Post Paging 186 if ( is_singular() && get_query_var('page') && $redirect_url ) { 187 $redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); 188 $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); 187 189 } 188 190
Note: See TracChangeset
for help on using the changeset viewer.