On this page
WP_Sitemaps_Renderer::check_for_simple_xml_availability()
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Checks for the availability of the SimpleXML extension and errors if missing.
Source
File: wp-includes/sitemaps/class-wp-sitemaps-renderer.php. View all references
private function check_for_simple_xml_availability() {
if ( ! class_exists( 'SimpleXMLElement' ) ) {
add_filter(
'wp_die_handler',
static function () {
return '_xml_wp_die_handler';
}
);
wp_die(
sprintf(
/* translators: %s: SimpleXML */
esc_xml( __( 'Could not generate XML sitemap due to missing %s extension' ) ),
'SimpleXML'
),
esc_xml( __( 'WordPress › Error' ) ),
array(
'response' => 501, // "Not implemented".
)
);
}
}
Related
Uses
| Uses | Description |
|---|---|
| esc_xml() wp-includes/formatting.php | Escaping for XML blocks. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| wp_die() wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
| add_filter() wp-includes/plugin.php | Adds a callback function to a filter hook. |
Used By
| Used By | Description |
|---|---|
| WP_Sitemaps_Renderer::render_index() wp-includes/sitemaps/class-wp-sitemaps-renderer.php | Renders a sitemap index. |
| WP_Sitemaps_Renderer::render_sitemap() wp-includes/sitemaps/class-wp-sitemaps-renderer.php | Renders a sitemap. |
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_sitemaps_renderer/check_for_simple_xml_availability