diff -r 48c4eec2b7e6 -r 8c2e4d02f4ef wp/wp-includes/sitemaps/class-wp-sitemaps.php --- a/wp/wp-includes/sitemaps/class-wp-sitemaps.php Fri Sep 05 18:40:08 2025 +0200 +++ b/wp/wp-includes/sitemaps/class-wp-sitemaps.php Fri Sep 05 18:52:52 2025 +0200 @@ -75,7 +75,6 @@ $this->register_sitemaps(); // Add additional action callbacks. - add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 ); add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 ); } @@ -223,12 +222,15 @@ * Redirects a URL to the wp-sitemap.xml * * @since 5.5.0 + * @deprecated 6.7.0 Deprecated in favor of {@see WP_Rewrite::rewrite_rules()} * * @param bool $bypass Pass-through of the pre_handle_404 filter value. * @param WP_Query $query The WP_Query object. * @return bool Bypass value. */ public function redirect_sitemapxml( $bypass, $query ) { + _deprecated_function( __FUNCTION__, '6.7.0' ); + // If a plugin has already utilized the pre_handle_404 function, return without action to avoid conflicts. if ( $bypass ) { return $bypass;