From 85f73cf458080d0c1fefe88fda7e985ac4590f4b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 19 May 2014 06:52:14 +0000 Subject: [PATCH] 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 --- wp-admin/custom-background.php | 21 ++++++++++++++++++ wp-admin/custom-header.php | 22 +++++++++++++++++++ .../includes/class-wp-filesystem-base.php | 22 +++++++++++++++++++ wp-admin/includes/class-wp-list-table.php | 22 +++++++++++++++++++ wp-includes/cache.php | 22 +++++++++++++++++++ wp-includes/class-wp-ajax-response.php | 22 +++++++++++++++++++ wp-includes/class-wp-error.php | 22 +++++++++++++++++++ wp-includes/class-wp-walker.php | 22 +++++++++++++++++++ wp-includes/class-wp.php | 22 +++++++++++++++++++ 9 files changed, 197 insertions(+) diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index 8b72ab6ac7..9cd80e3a8f 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -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. diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 49025a9e40..2d33bd594a 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -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. * diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php index 08eaa0e384..f0b111b097 100644 --- a/wp-admin/includes/class-wp-filesystem-base.php +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -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. * diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index d4ccfcc7d5..b2ca8aa985 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -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 * diff --git a/wp-includes/cache.php b/wp-includes/cache.php index ce2cc00f7a..4bfaa5f462 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -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. * diff --git a/wp-includes/class-wp-ajax-response.php b/wp-includes/class-wp-ajax-response.php index 4653a7ca0b..e764ed106d 100644 --- a/wp-includes/class-wp-ajax-response.php +++ b/wp-includes/class-wp-ajax-response.php @@ -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. * diff --git a/wp-includes/class-wp-error.php b/wp-includes/class-wp-error.php index 7de5812f56..b048584e14 100644 --- a/wp-includes/class-wp-error.php +++ b/wp-includes/class-wp-error.php @@ -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. * diff --git a/wp-includes/class-wp-walker.php b/wp-includes/class-wp-walker.php index 5cb576506f..c5e3b5129b 100644 --- a/wp-includes/class-wp-walker.php +++ b/wp-includes/class-wp-walker.php @@ -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. * diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index 91dc2348d8..17a3be3066 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -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 *