17 const COLOR =
'WP_Customize_Color_Control';
19 const IMAGE =
'WP_Customize_Image_Control';
23 const UPLOAD =
'WP_Customize_Upload_Control';
34 self::COLOR => self::COLOR,
35 self::CHECKBOX => self::CHECKBOX,
36 self::DROP_DOWN_PAGES => self::DROP_DOWN_PAGES,
37 self::IMAGE => self::IMAGE,
38 self::RADIO => self::RADIO,
39 self::SELECT => self::SELECT,
40 self::TEXT => self::TEXT,
41 self::UPLOAD => self::UPLOAD
44 return apply_filters(
'wpdk_theme_customize_controls_type', $controls );
56 self::COLOR => self::COLOR,
57 self::IMAGE => self::IMAGE,
58 self::UPLOAD => self::UPLOAD
61 return apply_filters(
'wpdk_theme_customize_controls_instanceable', $controls );
90 add_action(
'customize_register', array( $this,
'customize_register' ) );
93 add_action(
'wp_head', array( $this,
'wp_head' ) );
96 add_action(
'customize_preview_init', array( $this,
'customize_preview_init' ) );
127 if ( empty( $sections ) ) {
135 foreach ( $sections as $section_id => $section_args ) {
137 $wp_customize->add_section( $section_id, $section_args );
139 if ( isset( $section_args[
'_setting'] ) ) {
142 foreach ( $section_args[
'_setting'] as $setting_id => $setting_args ) {
143 $wp_customize->add_setting( $setting_id, $setting_args );
145 if ( isset( $setting_args[
'_control'] ) ) {
148 $control_args = $setting_args[
'_control'];
149 $control_args[
'section'] = $section_id;
151 if ( in_array( $control_args[
'type'], $instanceable ) ) {
153 $class_name = $control_args[
'type'];
155 unset( $control_args[
'type'] );
157 $control_args[
'settings'] = $setting_id;
159 $control =
new $class_name( $wp_customize, $setting_id, $control_args );
160 $wp_customize->add_control( $control, $control_args );
163 $wp_customize->add_control( $setting_id, $control_args );