Alert: 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.

WP_Sitemaps_Renderer::check_for_simple_xml_availability() WordPress Method

This method checks to see if SimpleXML is available. If it is, it will return true. If it is not, it will return false.

WP_Sitemaps_Renderer::check_for_simple_xml_availability() #

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


Source

File: wp-includes/sitemaps/class-wp-sitemaps-renderer.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 › Error' ) ),
				array(
					'response' => 501, // "Not implemented".
				)
			);
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.