diff options
Diffstat (limited to 'plugins/jetpack/modules/sitemaps/sitemaps.php')
-rw-r--r-- | plugins/jetpack/modules/sitemaps/sitemaps.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/sitemaps/sitemaps.php b/plugins/jetpack/modules/sitemaps/sitemaps.php index c9e4265a..3620957c 100644 --- a/plugins/jetpack/modules/sitemaps/sitemaps.php +++ b/plugins/jetpack/modules/sitemaps/sitemaps.php @@ -137,6 +137,10 @@ class Jetpack_Sitemap_Manager { private function serve_raw_and_die( $the_content_type, $the_content ) { header( 'Content-Type: ' . $the_content_type . '; charset=UTF-8' ); + global $wp_query; + $wp_query->is_feed = true; + set_query_var( 'feed', 'sitemap' ); + if ( '' === $the_content ) { wp_die( esc_html__( "No sitemap found. Maybe it's being generated. Please try again later.", 'jetpack' ), @@ -518,4 +522,4 @@ function jetpack_sitemap_uri( $filename = 'sitemap.xml' ) { * @param string $sitemap_url Sitemap URL. */ return apply_filters( 'jetpack_sitemap_location', $sitemap_url ); -}
\ No newline at end of file +} |