diff --git a/src/wp-admin/custom-background.php b/src/wp-admin/custom-background.php index 46a61ccbb1..8b72ab6ac7 100644 --- a/src/wp-admin/custom-background.php +++ b/src/wp-admin/custom-background.php @@ -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. * diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 81ff4d6a0b..49025a9e40 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -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. * diff --git a/src/wp-admin/includes/class-wp-filesystem-base.php b/src/wp-admin/includes/class-wp-filesystem-base.php index 86ff7a78db..08eaa0e384 100644 --- a/src/wp-admin/includes/class-wp-filesystem-base.php +++ b/src/wp-admin/includes/class-wp-filesystem-base.php @@ -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. * diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 76552d08fe..d4ccfcc7d5 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -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 * diff --git a/src/wp-includes/cache.php b/src/wp-includes/cache.php index 734c968140..ce2cc00f7a 100644 --- a/src/wp-includes/cache.php +++ b/src/wp-includes/cache.php @@ -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. * diff --git a/src/wp-includes/class-wp-ajax-response.php b/src/wp-includes/class-wp-ajax-response.php index b32f7aa535..4653a7ca0b 100644 --- a/src/wp-includes/class-wp-ajax-response.php +++ b/src/wp-includes/class-wp-ajax-response.php @@ -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. * diff --git a/src/wp-includes/class-wp-error.php b/src/wp-includes/class-wp-error.php index e93d464cc9..7de5812f56 100644 --- a/src/wp-includes/class-wp-error.php +++ b/src/wp-includes/class-wp-error.php @@ -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. * diff --git a/src/wp-includes/class-wp-walker.php b/src/wp-includes/class-wp-walker.php index 7ee5faf1fa..5cb576506f 100644 --- a/src/wp-includes/class-wp-walker.php +++ b/src/wp-includes/class-wp-walker.php @@ -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. * diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php index 2b0590c99a..91dc2348d8 100644 --- a/src/wp-includes/class-wp.php +++ b/src/wp-includes/class-wp.php @@ -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 *