Strip p, page_id, attachment_id, post_type, pagename, and name from redirect query if we get a hit on a 404-guessed permalink. fixes #20374
git-svn-id: http://svn.automattic.com/wordpress/trunk@20380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
789b3714d3
commit
2bca2af5fd
|
@ -92,8 +92,10 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( ! $redirect_url )
|
||||
if ( ! $redirect_url ) {
|
||||
$redirect_url = redirect_guess_404_permalink( $requested_url );
|
||||
$redirect['query'] = remove_query_arg( array( 'p', 'page_id', 'attachment_id', 'post_type', 'pagename', 'name' ), $redirect['query'] );
|
||||
}
|
||||
|
||||
} elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) {
|
||||
// rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101
|
||||
|
|
Loading…
Reference in New Issue