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
Fix canonical tests and page for posts not redirected #634
Conversation
This will avoid to duplicate filters from several instances of PLL_Frontend_Static_Pages (from the test and the PLL_Frontend::init() call in the setup)
Data is only needed when WordPress sitemaps module will generate the actual sitemaps, rewrite rules are not modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, we needed a first test to run in order to reset the $GLOBAL['wp_sitemaps']
variable: https://github.com/WordPress/wordpress-develop/blob/eb9fb00ee60ed392179f7f8148a2b4fcf6b05ff9/tests/phpunit/includes/abstract-testcase.php#L161
@@ -387,20 +387,20 @@ public function check_canonical_url( $requested_url = '', $do_redirect = true ) | |||
if ( $this->model->is_translated_taxonomy( $this->get_queried_taxonomy( $wp_query->tax_query ) ) ) { | |||
$term_id = $this->get_queried_term_id( $wp_query->tax_query ); | |||
$language = $this->model->term->get_language( $term_id ); | |||
$redirect_url = get_term_link( $term_id ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make an explanation in a new PR
This PR fixes the canonical tests:
This revealed that
test_page_for_post_option_should_be_translated_from_plain_permalink()
was wrongly passing.=> Fix the code accordingly.