From ccdfdb2c8e1fbe722dc908789dc7e7c409bd8d7e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 24 Jun 2014 22:55:56 +0000 Subject: [PATCH] Allow for easier adding of custom class variables when extending WP_Customize_Section or WP_Customize_Setting. props rhurling. fixes #27315. git-svn-id: https://develop.svn.wordpress.org/trunk@28827 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-section.php | 2 +- src/wp-includes/class-wp-customize-setting.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-customize-section.php b/src/wp-includes/class-wp-customize-section.php index 2a9214f19e..2cfae71a63 100644 --- a/src/wp-includes/class-wp-customize-section.php +++ b/src/wp-includes/class-wp-customize-section.php @@ -94,7 +94,7 @@ class WP_Customize_Section { * @param array $args Section arguments. */ public function __construct( $manager, $id, $args = array() ) { - $keys = array_keys( get_class_vars( __CLASS__ ) ); + $keys = array_keys( get_object_vars( $this ) ); foreach ( $keys as $key ) { if ( isset( $args[ $key ] ) ) $this->$key = $args[ $key ]; diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index 33707de9f6..bb5fb75f59 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -76,7 +76,7 @@ class WP_Customize_Setting { * @return WP_Customize_Setting $setting */ public function __construct( $manager, $id, $args = array() ) { - $keys = array_keys( get_class_vars( __CLASS__ ) ); + $keys = array_keys( get_object_vars( $this ) ); foreach ( $keys as $key ) { if ( isset( $args[ $key ] ) ) $this->$key = $args[ $key ];