Some classes with `__get()` method also need `__set()`.

See #27881, #22234.

Built from https://develop.svn.wordpress.org/trunk@28521


git-svn-id: http://core.svn.wordpress.org/trunk@28347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-19 06:31:15 +00:00
parent 2e9ce6fc87
commit 821246b4ae
9 changed files with 110 additions and 1 deletions

View File

@ -69,6 +69,19 @@ class Custom_Background {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Set up the hooks for the Custom Background admin page.
*

View File

@ -91,6 +91,18 @@ class Custom_Image_Header {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Set up the hooks for the Custom Header admin page.
*

View File

@ -55,6 +55,18 @@ class WP_Filesystem_Base {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Return the path on the remote filesystem of ABSPATH.
*

View File

@ -106,6 +106,18 @@ class WP_List_Table {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Make private/protected methods readable for backwards compatibility
*

View File

@ -268,7 +268,7 @@ class WP_Object_Cache {
* @access private
* @since 2.0.0
*/
public $cache = array();
private $cache = array();
/**
* The amount of times the cache data was already stored in the cache.
@ -317,6 +317,18 @@ class WP_Object_Cache {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Adds data to the cache if it doesn't already exist.
*

View File

@ -40,6 +40,18 @@ class WP_Ajax_Response {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Append to XML response based on given arguments.
*

View File

@ -75,6 +75,18 @@ class WP_Error {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Retrieve all error codes.
*

View File

@ -50,6 +50,18 @@ class Walker {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Starts the list before the elements are added.
*

View File

@ -673,6 +673,18 @@ class WP_MatchesMapRegex {
return $this->$name;
}
/**
* Make private properties setable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @param string $value
* @return mixed
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Make private/protected methods readable for backwards compatibility
*