diff --git a/wp-includes/class-wp-ajax-response.php b/wp-includes/class-wp-ajax-response.php index 0a8016c980..b32f7aa535 100644 --- a/wp-includes/class-wp-ajax-response.php +++ b/wp-includes/class-wp-ajax-response.php @@ -13,7 +13,7 @@ class WP_Ajax_Response { * @var array * @access private */ - var $responses = array(); + private $responses = array(); /** * Constructor - Passes args to {@link WP_Ajax_Response::add()}. @@ -24,11 +24,22 @@ class WP_Ajax_Response { * @param string|array $args Optional. Will be passed to add() method. * @return WP_Ajax_Response */ - function __construct( $args = '' ) { + public function __construct( $args = '' ) { if ( !empty($args) ) $this->add($args); } + /** + * Make private properties readable for backwards compatibility + * + * @since 4.0.0 + * @param string $name + * @return mixed + */ + public function __get( $name ) { + return $this->$name; + } + /** * Append to XML response based on given arguments. * @@ -52,7 +63,7 @@ class WP_Ajax_Response { * @param string|array $args Override defaults. * @return string XML response. */ - function add( $args = '' ) { + public function add( $args = '' ) { $defaults = array( 'what' => 'object', 'action' => false, 'id' => '0', 'old_id' => false, @@ -133,7 +144,7 @@ class WP_Ajax_Response { * * @since 2.1.0 */ - function send() { + public function send() { header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) ); echo ""; foreach ( (array) $this->responses as $response )