Skip to content

Fix taxonomy URLs without path component in canonical redirection. #8664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/wp-includes/canonical.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,11 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
// Taxonomy accessible via ?taxonomy=...&term=... or any custom query var.
parse_str( $tax_url['query'], $query_vars );
$redirect['query'] = add_query_arg( $query_vars, $redirect['query'] );
} else {
} elseif ( isset( $tax_url['path'] ) ) {
// Taxonomy is accessible via a "pretty URL".
$redirect['path'] = $tax_url['path'];
} else {
$redirect['path'] = '';
}
} else {
// Some query vars are set via $_GET. Unset those from $_GET that exist via the rewrite.
Expand Down
Loading