rebase on oct-10-2023
This commit is contained in:
@@ -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' );
|
||||
|
||||
Reference in New Issue
Block a user