Classes that have __set() also need __isset() and __unset().

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28524 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-05-19 06:51:35 +00:00
parent bf54ad6054
commit daecbc9659
9 changed files with 197 additions and 0 deletions

View File

@@ -87,6 +87,28 @@ class WP_Error {
return $this->$name = $value;
}
/**
* Make private properties checkable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @return mixed
*/
public function __isset( $name ) {
return isset( $this->$name );
}
/**
* Make private properties unsetable for backwards compatibility
*
* @since 4.0.0
* @param string $name
* @return mixed
*/
public function __unset( $name ) {
unset( $this->$name );
}
/**
* Retrieve all error codes.
*