WordPress at a glance
function is not described

WP_Sitemaps_Renderer::check_for_simple_xml_availability() private WP 5.5.0

Checks for the availability of the SimpleXML extension and errors if missing.

{} It's a method of the class: WP_Sitemaps_Renderer{}

No Hooks.

Return

Null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->check_for_simple_xml_availability();

Changelog

Since 5.5.0 Introduced.

Code of WP_Sitemaps_Renderer::check_for_simple_xml_availability() WP 5.5.1

<?php
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 &rsaquo; Error' ) ),
			array(
				'response' => 501, // "Not implemented".
			)
		);
	}
}