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
This commit is contained in:
parent
6385135983
commit
ccdfdb2c8e
@ -94,7 +94,7 @@ class WP_Customize_Section {
|
|||||||
* @param array $args Section arguments.
|
* @param array $args Section arguments.
|
||||||
*/
|
*/
|
||||||
public function __construct( $manager, $id, $args = array() ) {
|
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 ) {
|
foreach ( $keys as $key ) {
|
||||||
if ( isset( $args[ $key ] ) )
|
if ( isset( $args[ $key ] ) )
|
||||||
$this->$key = $args[ $key ];
|
$this->$key = $args[ $key ];
|
||||||
|
@ -76,7 +76,7 @@ class WP_Customize_Setting {
|
|||||||
* @return WP_Customize_Setting $setting
|
* @return WP_Customize_Setting $setting
|
||||||
*/
|
*/
|
||||||
public function __construct( $manager, $id, $args = array() ) {
|
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 ) {
|
foreach ( $keys as $key ) {
|
||||||
if ( isset( $args[ $key ] ) )
|
if ( isset( $args[ $key ] ) )
|
||||||
$this->$key = $args[ $key ];
|
$this->$key = $args[ $key ];
|
||||||
|
Loading…
Reference in New Issue
Block a user