mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
WP_Ajax_Response
has one property only, $responses
. It was public until [28508], when it became private
in name only. Is it worth 4 magic methods to pretend that this property is private
? It is not.
Make it `public` and remove the magic methods. See #30891. Built from https://develop.svn.wordpress.org/trunk@31139 git-svn-id: http://core.svn.wordpress.org/trunk@31120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d8e5aabab5
commit
c9bc1cc46e
@ -11,9 +11,8 @@ class WP_Ajax_Response {
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
private $responses = array();
|
||||
public $responses = array();
|
||||
|
||||
/**
|
||||
* Constructor - Passes args to {@link WP_Ajax_Response::add()}.
|
||||
@ -28,58 +27,6 @@ class WP_Ajax_Response {
|
||||
$this->add($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make private properties readable for backwards compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $name Property to get.
|
||||
* @return mixed Property.
|
||||
*/
|
||||
public function __get( $name ) {
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make private properties settable for backwards compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $name Property to set.
|
||||
* @param mixed $value Property value.
|
||||
* @return mixed Newly-set property.
|
||||
*/
|
||||
public function __set( $name, $value ) {
|
||||
return $this->$name = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make private properties checkable for backwards compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $name Property to check if set.
|
||||
* @return bool Whether the property is set.
|
||||
*/
|
||||
public function __isset( $name ) {
|
||||
return isset( $this->$name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Make private properties un-settable for backwards compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $name Property to unset.
|
||||
*/
|
||||
public function __unset( $name ) {
|
||||
unset( $this->$name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Append to XML response based on given arguments.
|
||||
*
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31138';
|
||||
$wp_version = '4.2-alpha-31139';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user