mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user