Make WordPress Core


Ignore:
Timestamp:
10/14/2024 08:47:34 AM (16 months ago)
Author:
swissspidy
Message:

Sitemaps: Improve sitemap.xml redirects when using custom permalinks.

Changes the way redirects from sitemap.xml to wp-sitemap.xml happen, so that they also work when using a more complex custom rewrite structure.

Props gmariani405, swissspidy, euthelup, peterwilsoncc.
Fixes #61931.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps.php

    r55000 r59228  
    7676
    7777        // Add additional action callbacks.
    78         add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );
    7978        add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );
    8079    }
     
    224223     *
    225224     * @since 5.5.0
     225     * @deprecated 6.7.0 Deprecated in favor of {@see WP_Rewrite::rewrite_rules()}
    226226     *
    227227     * @param bool     $bypass Pass-through of the pre_handle_404 filter value.
Note: See TracChangeset for help on using the changeset viewer.