var $responses = array();
/**
- * PHP4 Constructor - Passes args to {@link WP_Ajax_Response::add()}.
+ * Constructor - Passes args to {@link WP_Ajax_Response::add()}.
*
* @since 2.1.0
* @see WP_Ajax_Response::add()
* @param string|array $args Optional. Will be passed to add() method.
* @return WP_Ajax_Response
*/
- function WP_Ajax_Response( $args = '' ) {
+ function __construct( $args = '' ) {
if ( !empty($args) )
$this->add($args);
}
* @since 2.1.0
*/
function send() {
- header('Content-Type: text/xml');
- echo "<?xml version='1.0' standalone='yes'?><wp_ajax>";
+ 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>';
- die();
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
+ wp_die();
+ else
+ die();
}
}
-
-?>