Skip to content

Commit

Permalink
Respect WPCOM_SKIP_DEFAULT_SITEMAP constant (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonascalves authored Jan 30, 2024
1 parent f720e5e commit 31e3224
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions msm-sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function setup() {
add_action( 'init', array( __CLASS__, 'create_post_type' ) );
add_filter( 'posts_pre_query', array( __CLASS__, 'disable_main_query_for_sitemap_xml' ), 10, 2 );
add_filter( 'template_include', array( __CLASS__, 'load_sitemap_template' ) );

// Disable WordPress 5.5-era sitemaps.
add_filter( 'wp_sitemaps_enabled', '__return_false' );

Expand Down Expand Up @@ -67,7 +67,9 @@ public static function sitemap_15_min_cron_interval( $schedules ) {
* Register endpoint for sitemap and other hooks
*/
public static function sitemap_init() {
define( 'WPCOM_SKIP_DEFAULT_SITEMAP', true );
if ( ! defined( 'WPCOM_SKIP_DEFAULT_SITEMAP' ) ) {
define( 'WPCOM_SKIP_DEFAULT_SITEMAP', true );
}

self::sitemap_rewrite_init();

Expand Down

0 comments on commit 31e3224

Please sign in to comment.