WP_Ajax_Response::send()publicWP 2.1.0

Display XML formatted responses.

Sets the content type header to text/xml.

Метод класса: WP_Ajax_Response{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_Ajax_Response = new WP_Ajax_Response();
$WP_Ajax_Response->send();

Список изменений

С версии 2.1.0 Введена.

Код WP_Ajax_Response::send() WP 6.5.2

public function send() {
	header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );
	echo "<?xml version='1.0' encoding='" . get_option( 'blog_charset' ) . "' standalone='yes'?><wp_ajax>";
	foreach ( (array) $this->responses as $response ) {
		echo $response;
	}
	echo '</wp_ajax>';
	if ( wp_doing_ajax() ) {
		wp_die();
	} else {
		die();
	}
}