render_content() for the internals.
* Add extra class names
*
* @since 2.0.0
*/
protected function render() {
$id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
$class = 'customize-control customize-control-' . $this->type . ' hoot-customize-control-' . $this->type . $this->group . ' hoot-control-id-' . $this->identifier;
?>
render_content(); ?>
type ) {
case 'group' :
switch ( $this->group ) {
case 'start' :
if ( ! empty( $this->label ) ) : ?>
label ); ?>
description ) ) : ?>
description ; ?>
sublabel ) ) : ?>
sublabel ; ?>
button ) ? __( 'Edit Group', 'chromatic' ) : $this->button;
?>
add_control(
new Hoot_Customize_Group_Control( $wp_customize, $id, $setting )
);
break;
case 'group-end':
case 'groupend':
$setting['type'] = 'group';
$setting['group'] = 'end';
$wp_customize->add_control(
new Hoot_Customize_Group_Control( $wp_customize, $id, $setting )
);
break;
case 'group':
case 'groups':
$setting['type'] = 'group';
$wp_customize->add_control(
new Hoot_Customize_Group_Control( $wp_customize, $id, $setting )
);
break;
}
endif;
}
add_action( 'hoot_customizer_control_interface', 'hoot_customizer_group_control_interface', 10, 3 );
endif;
/**
* Modify the settings array and prepare group settings for Customizer Library Interface functions
*
* @since 2.0.0
* @param array $value
* @param string $key
* @param array $setting
* @param int $count
* @return void
*/
function hoot_customizer_prepare_group_settings( $value, $key, $setting, $count ) {
if ( $setting['type'] == 'group' ) {
$setting = wp_parse_args( $setting, array(
'label' => '',
'section' => '',
'priority' => '',
'description' => '',
'button' => '',
'options' => array(),
'identifier' => $key,
) );
if( is_array( $setting['options'] ) && !empty( $setting['options'] ) ):
$value[ "group-{$count}" ] = array(
'label' => $setting['label'],
'section' => $setting['section'],
'type' => 'group',
'priority' => $setting['priority'],
'description' => $setting['description'],
'button' => $setting['button'],
'identifier' => $setting['identifier'],
'group' => 'start',
);
foreach ( $setting['options'] as $okey => $osetting ) {
// Add priority & section same as group
$osetting['priority'] = $setting['priority'];
$osetting['section'] = $setting['section'];
$value[ "{$key}-{$okey}" ] = $osetting;
}
$value[ "group-{$count}-end" ] = array(
'section' => $setting['section'],
'type' => 'group',
'priority' => $setting['priority'],
'identifier' => $setting['identifier'],
'group' => 'end',
);
endif;
}
return $value;
}
add_filter( 'hoot_customizer_prepare_settings', 'hoot_customizer_prepare_group_settings', 10, 4 );
/**
* Add Content to Customizer Panel Footer
*
* @since 2.0.0
* @return void
*/
// Only load in customizer (not in frontend)
if ( class_exists( 'WP_Customize_Control' ) ) :
function hoot_customizer_footer_groupcontent() {
?>