Used By
Used By | Description |
---|---|
wp-includes/functions.php: wp_die() | Kills WordPress execution and displays HTML page with an error message. |
Checks whether current request is an XML request, or is expecting an XML response.
(bool) True if Accepts
or Content-Type
headers contain text/xml
or one of the related MIME types. False otherwise.
File: wp-includes/load.php
function wp_is_xml_request() { $accepted = array( 'text/xml', 'application/rss+xml', 'application/atom+xml', 'application/rdf+xml', 'text/xml+oembed', 'application/xml+oembed', ); if ( isset( $_SERVER['HTTP_ACCEPT'] ) ) { foreach ( $accepted as $type ) { if ( false !== strpos( $_SERVER['HTTP_ACCEPT'], $type ) ) { return true; } } } if ( isset( $_SERVER['CONTENT_TYPE'] ) && in_array( $_SERVER['CONTENT_TYPE'], $accepted, true ) ) { return true; } return false; }
Version | Description |
---|---|
5.2.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_xml_request