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

See #27881, #22234.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-19 06:52:14 +00:00
parent 949cfd7a34
commit 85f73cf458
9 changed files with 197 additions and 0 deletions

View File

@ -81,6 +81,27 @@ class Custom_Background {
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 );
}
/**
* Set up the hooks for the Custom Background admin page.

View File

@ -103,6 +103,28 @@ class Custom_Image_Header {
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 );
}
/**
* Set up the hooks for the Custom Header admin page.
*

View File

@ -67,6 +67,28 @@ class WP_Filesystem_Base {
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 );
}
/**
* Return the path on the remote filesystem of ABSPATH.
*

View File

@ -118,6 +118,28 @@ class WP_List_Table {
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 );
}
/**
* Make private/protected methods readable for backwards compatibility
*

View File

@ -329,6 +329,28 @@ class WP_Object_Cache {
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 );
}
/**
* Adds data to the cache if it doesn't already exist.
*

View File

@ -52,6 +52,28 @@ class WP_Ajax_Response {
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 );
}
/**
* Append to XML response based on given arguments.
*

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.
*

View File

@ -62,6 +62,28 @@ class Walker {
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 );
}
/**
* Starts the list before the elements are added.
*

View File

@ -685,6 +685,28 @@ class WP_MatchesMapRegex {
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 );
}
/**
* Make private/protected methods readable for backwards compatibility
*