Allow for easier adding of custom class variables when extending WP_Customize_Section or WP_Customize_Setting.

props rhurling.
fixes #27315.
Built from https://develop.svn.wordpress.org/trunk@28827


git-svn-id: http://core.svn.wordpress.org/trunk@28631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-06-24 22:56:14 +00:00
parent cc0c90e05a
commit c6ef7d05e0
2 changed files with 2 additions and 2 deletions

View File

@ -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 ];

View File

@ -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 ];