rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -5,6 +5,8 @@
* @package WPSEO\XML_Sitemaps
*/
use Yoast\WP\SEO\Conditionals\Deactivating_Yoast_Seo_Conditional;
/**
* Rewrite setup and handling for sitemaps functionality.
*/
@@ -14,6 +16,10 @@ class WPSEO_Sitemaps_Router {
* Sets up init logic.
*/
public function __construct() {
// If we add rewrite rules during the plugin's deactivation, the flush_rewrite_rules that we perform afterwards won't properly flush those new rules.
if ( YoastSEO()->classes->get( Deactivating_Yoast_Seo_Conditional::class )->is_met() ) {
return;
}
add_action( 'init', [ $this, 'init' ], 1 );
add_filter( 'redirect_canonical', [ $this, 'redirect_canonical' ] );
@@ -24,7 +30,6 @@ class WPSEO_Sitemaps_Router {
* Sets up rewrite rules.
*/
public function init() {
global $wp;
$wp->add_query_var( 'sitemap' );