Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-includes/canonical.php

    r15708 r15463  
    104104            if ( $redirect_url = get_permalink(get_query_var('p')) )
    105105                $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            }
    106110        } elseif ( is_single() && !empty($_GET['name'])  && ! $redirect_url ) {
    107111            if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) )
     
    177181            }
    178182        } 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');
    180184            $post_terms = wp_get_object_terms($wp_query->get_queried_object_id(), 'category', array('fields' => 'tt_ids'));
    181185            if ( (!$category || is_wp_error($category)) || ( !is_wp_error($post_terms) && !empty($post_terms) && !in_array($category->term_taxonomy_id, $post_terms) ) )
    182186                $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'] );
    189187        }
    190188
Note: See TracChangeset for help on using the changeset viewer.