You appear to be a bot. Output may be restricted
Description
Echo a raw string of given content-type.
Usage
Jetpack_Sitemap_Manager::serve_raw_and_die( $the_content_type, $the_content );
Parameters
- $the_content_type
- ( string ) required – The content type to be served.
- $the_content
- ( string ) required – The string to be echoed.
Returns
void
Source
File name: jetpack/modules/sitemaps/sitemaps.php
Lines:
1 to 28 of 28
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 ) { $error = __( 'No sitemap found. Please try again later.', 'jetpack' ); if ( current_user_can( 'manage_options' ) ) { $next = human_time_diff( wp_next_scheduled( 'jp_sitemap_cron_hook' ) ); /* translators: %s is a human_time_diff until next sitemap generation. */ $error = sprintf( __( 'No sitemap found. The system will try to build it again in %s.', 'jetpack' ), $next ); } wp_die( esc_html( $error ), esc_html__( 'Sitemaps', 'jetpack' ), array( 'response' => 404, ) ); } echo $the_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content created by Jetpack. die(); }