- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-includes/canonical.php
r15708 r15463 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 } 106 110 } elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) { 107 111 if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) … … 177 181 } 178 182 } elseif ( is_single() && strpos($wp_rewrite->permalink_structure, '%category%') !== false ) { 179 $category = get_ category_by_path(get_query_var('category_name'));183 $category = get_term_by('slug', get_query_var('category_name'), 'category'); 180 184 $post_terms = wp_get_object_terms($wp_query->get_queried_object_id(), 'category', array('fields' => 'tt_ids')); 181 185 if ( (!$category || is_wp_error($category)) || ( !is_wp_error($post_terms) && !empty($post_terms) && !in_array($category->term_taxonomy_id, $post_terms) ) ) 182 186 $redirect_url = get_permalink($wp_query->get_queried_object_id()); 183 }184 185 // Post Paging186 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'] );189 187 } 190 188
Note: See TracChangeset
for help on using the changeset viewer.