Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#27315 closed enhancement

Easier adding of custom class variables when extending WP_Customize_Section — at Initial Version

Reported by: rhurling Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.4
Component: Customize Keywords: has-patch commit
Focuses: administration Cc:


WP_Customize_Section uses $keys = array_keys( get_class_vars( __CLASS__ ) ); to set class variables, but WP_Customize_Control uses $keys = array_keys( get_object_vars( $this ) ); to set class variables.

The difference is that if you extend WP_Customize_Control you can add new class variables by setting them in the extended class and passing them to the args array in the constructor.
In WP_Customize_Section one has to override the constructor to do the same.

$keys = array_keys( get_class_vars( __CLASS__ ) );
$keys = array_keys( get_object_vars( $this ) );
in WP_Customize_Section would solve the problem (or use the static keyword which would raise the requirements to PHP 5.3)

Change History (0)

Note: See TracTickets for help on using tickets.