Properly handled posts with internal paging in Canonical

git-svn-id: http://svn.automattic.com/wordpress/trunk@9388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-10-28 19:21:23 +00:00
parent 9ad53f6d7c
commit f614aea244
1 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,10 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
$redirect['query'] = remove_query_arg('p', $redirect['query']); $redirect['query'] = remove_query_arg('p', $redirect['query']);
} elseif ( is_single() && ! $redirect_url ) { } elseif ( is_single() && ! $redirect_url ) {
$redirect_url = get_permalink( url_to_postid( $requested_url ) ); $redirect_url = get_permalink( url_to_postid( $requested_url ) );
if ( get_query_var( 'page' ) ) {
$redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );
$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
}
} elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) { } elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) {
if ( $redirect_url = get_permalink(get_query_var('page_id')) ) if ( $redirect_url = get_permalink(get_query_var('page_id')) )
$redirect['query'] = remove_query_arg('page_id', $redirect['query']); $redirect['query'] = remove_query_arg('page_id', $redirect['query']);