mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Canonical redirects for post name queries. Props DD32. see #6516
git-svn-id: http://svn.automattic.com/wordpress/trunk@11745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
46ece84195
commit
b64cc30cf8
@ -91,6 +91,9 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
||||
$redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );
|
||||
$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
|
||||
}
|
||||
} elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) {
|
||||
if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) )
|
||||
$redirect['query'] = remove_query_arg('name', $redirect['query']);
|
||||
} elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) {
|
||||
if ( $redirect_url = get_permalink(get_query_var('page_id')) )
|
||||
$redirect['query'] = remove_query_arg('page_id', $redirect['query']);
|
||||
|
Loading…
Reference in New Issue
Block a user