id ) );
$class = 'customize-control customize-control-' . $this->type; ?>
render_content(); ?>
choices ) )
return;
$name = '_customize-radio-' . $this->id;
if ( ! empty( $this->label ) ) : ?>
label, 'ac-repair' ); ?>
description ) ) : ?>
description ; ?>
choices as $value => $label ) : ?>
id;
if ( ! empty( $this->label ) ) : ?>
label, 'ac-repair' ); ?>
description ) ) : ?>
description ; ?>
choices ) )
return;
?>
label, 'ac-repair' ); ?>
link(); ?> value="value(); ?>" style="width:50%;" />
link(); ?> style="width:90%;" >
add_section( $value['name'], array(
'title' => $value['name'],
'description' => $value['description'],
'priority' => $value['priority'],
) );
break;
case "text" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
'transport' => 'postMessage',
) );
$wp_customize->add_control( 'mh_options_'.$value['id'] , array(
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id'].']',
'type' => $value['type'],
) );
break;
case "margin" :
$wp_customize->add_setting( 'mh_options['.$value['id_1'].']', array(
'default' => $value['default_1'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_1'], array (
'label' => $value['label_1'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_1'].']',
'type' => 'number',
'fieldwidth' => absint('50'), //set the field to 50% width so that we can display a second one next to it
) ) );
$wp_customize->add_setting( 'mh_options['.$value['id_2'].']', array(
'default' => $value['default_2'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_2'], array (
'label' => $value['label_2'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_2'].']',
'type' => 'number',
'fieldwidth' => absint('50'), //set the field to 50% width so that we can display a second one next to it
) ) );
$wp_customize->add_setting( 'mh_options['.$value['id_3'].']', array(
'default' => $value['default_3'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_3'], array (
'label' => $value['label_3'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_3'].']',
'type' => 'number',
'fieldwidth' => absint('50'), //set the field to 50% width so that we can display a second one next to it
) ) );
$wp_customize->add_setting( 'mh_options['.$value['id_4'].']', array(
'default' => $value['default_4'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_4'], array (
'label' => $value['label_4'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_4'].']',
'type' => 'number',
'fieldwidth' => absint('50'), //set the field to 50% width so that we can display a second one next to it
) ) );
break;
case "map" :
$wp_customize->add_setting( 'mh_options['.$value['id_1'].']', array(
'default' => $value['default_1'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( 'mh_options_'.$value['id_1'] , array(
'label' => mh_customizer_string_combine( $value['name'], $value['label_1'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_1'].']',
'type' => $value['type'],
'input_attrs' => array(
'class' => 'MapLat',
),
) );
$wp_customize->add_setting( 'mh_options['.$value['id_2'].']', array(
'default' => $value['default_2'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( 'mh_options_'.$value['id_2'] , array(
'label' => mh_customizer_string_combine( $value['name'], $value['label_2'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_2'].']',
'type' => $value['type'],
'input_attrs' => array(
'class' => 'MapLon',
),
) );
$wp_customize->add_setting( 'mh_options[map_canvas]', array(
'default' => $value['default'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Google_Map_Control( $wp_customize, 'map_canvas', array(
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options[map_canvas]',
'type' => $value['type'],
) ) );
break;
case "date-picker":
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Date_Picker_Control( $wp_customize, 'mh_options_'.$value['id'] , array(
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id'].']',
'type' => 'date',
) ) );
break;
case "textarea" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( 'mh_options_'.$value['id'], array(
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id'].']',
'type' => 'textarea',
) );
break;
case "radio" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control( new Customizer_Radio_Control($wp_customize, 'mh_options_'.$value['id'], array(
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id'].']',
'type' => 'radio',
'choices' => $value['options'],
'transport' => 'postMessage',
) ) );
break;
case "checkbox" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']' , array(
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control( new Customizer_Checkbox_Control($wp_customize, 'mh_options_'.$value['id'], array(
'label' => $value['name'],
'settings' => 'mh_options['.$value['id'].']',
'section' => $value['section'],
'type' => 'checkbox',
) ) );
break;
case "select" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control('mh_options_'.$value['id'], array(
'settings' => 'mh_options['.$value['id'].']',
'label' => $value['name'],
'section' => $value['section'],
'type' => 'select',
'choices' => $value['options'],
));
break;
case "multiselect" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control( new Customize_Multiple_Select_Control( $wp_customize, 'mh_options_'.$value['id'], array(
'settings' => 'mh_options['.$value['id'].']',
'label' => $value['name'],
'section' => $value['section'],
'type' => 'multiselect',
'choices' => $value['options'],
)));
break;
case "image" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control( new WP_Customize_Upload_Control( $wp_customize, 'mh_options_'.$value['id'] , array(
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id'].']',
)));
break;
case "color" :
$wp_customize->add_setting('mh_options['.$value['id'].']', array(
'default' => $value['default'],
'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
'transport' => 'postMessage',
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mh_options_'.$value['id'], array(
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id'].']',
)));
break;
case "color_2":
$wp_customize->add_setting('mh_options['.$value['id_1'].']', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
'transport' => 'postMessage',
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mh_options_'.$value['id_1'], array(
'label' => mh_customizer_string_combine( $value['name'], $value['label_1'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_1'].']',
)));
$wp_customize->add_setting('mh_options['.$value['id_2'].']', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
'transport' => 'postMessage',
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'mh_options_'.$value['id_2'], array(
'label' => mh_customizer_string_combine( $value['name'], $value['label_2'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_2'].']',
)));
break;
case "spinner" :
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id'], array (
'label' => $value['name'],
'section' => $value['section'],
'settings' => 'mh_options['.$value['id'].']',
'type' => 'number',
'fieldwidth' => $value['style'],
) ) );
break;
case "range-validator":
$wp_customize->add_setting( 'mh_options['.$value['id'].']', array(
'default' => $value['default'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customization_Range_Validator_Control( $wp_customize, 'mh_options['.$value['id'].']', array(
'type' => 'range',
'section' => $value['section'],
'label' => $value['name'],
'input_attrs' => array(
'min' => 0,
'max' => 100,
'step' => 1,
'style' => 'color: #0a0; width:100%;',
),
) ) );
break;
case "typography" :
$wp_customize->add_setting( 'mh_options['.$value['id_1'].']', array(
'default' => $value['default_1'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_1'], array (
'label' => mh_customizer_string_combine( $value['name'], $value['label_1'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_1'].']',
'type' => 'number',
'fieldwidth' => '50',
) ) );
$wp_customize->add_setting( 'mh_options['.$value['id_2'].']', array(
'default' => $value['default_2'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_2'], array (
'label' => mh_customizer_string_combine( $value['name'], $value['label_2'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_2'].']',
'type' => 'number',
'fieldwidth' => '50',
) ) );
$wp_customize->add_setting( 'mh_options['.$value['id_3'].']', array(
'default' => $value['default_3'],
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control('mh_options_'.$value['id_3'], array(
'settings' => 'mh_options['.$value['id_3'].']',
'label' => mh_customizer_string_combine( $value['name'], $value['label_3'] ),
'section' => $value['section'],
'type' => 'select',
'choices' => $value['options_3'],
));
$wp_customize->add_setting('mh_options['.$value['id_4'].']', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
'transport' => 'postMessage',
));
$wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'mh_options_'.$value['id_4'], array(
'section' => $value['section'],
'label' => mh_customizer_string_combine( $value['name'], $value['label_4'] ),
'settings' => 'mh_options['.$value['id_4'].']',
)));
break;
case "body_typography" :
$wp_customize->add_setting( 'mh_options['.$value['id_1'].']', array(
'default' => $value['default_1'],
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control('mh_options_'.$value['id_1'], array(
'settings' => 'mh_options['.$value['id_1'].']',
'label' => mh_customizer_string_combine( $value['name'], $value['label_1'] ),
'section' => $value['section'],
'type' => 'select',
'choices' => $value['options_1'],
));
$wp_customize->add_setting( 'mh_options['.$value['id_2'].']', array(
'default' => $value['default_2'],
'capability' => 'edit_theme_options',
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
));
$wp_customize->add_control('mh_options_'.$value['id_2'], array(
'settings' => 'mh_options['.$value['id_2'].']',
'label' => mh_customizer_string_combine( $value['name'], $value['label_2'] ),
'section' => $value['section'],
'type' => 'select',
'choices' => $value['options_2'],
));
$wp_customize->add_setting( 'mh_options['.$value['id_3'].']', array(
'default' => $value['default_3'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_3'], array (
'label' => mh_customizer_string_combine( $value['name'], $value['label_3'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_3'].']',
'type' => 'number',
'fieldwidth' => '50',
) ) );
$wp_customize->add_setting( 'mh_options['.$value['id_4'].']', array(
'default' => $value['default_4'],
'type' => 'option',
'sanitize_callback' => 'fixit_function_sanitize_callback',
) );
$wp_customize->add_control( new Customizer_Typography_Control( $wp_customize, 'mh_options_'.$value['id_4'], array (
'label' => mh_customizer_string_combine( $value['name'], $value['label_4'] ),
'section' => $value['section'],
'settings' => 'mh_options['.$value['id_4'].']',
'type' => 'number',
'fieldwidth' => '50',
) ) );
break;
default : break;
endswitch;
endforeach;
/**
* Customizer tools
*/
add_action('customize_controls_print_styles', 'fixit_live_customizer_css' );
function fixit_live_customizer_css(){
print '';
}
add_action( 'wp_footer', 'fixit_live_customizer_js', 30 );
function fixit_live_customizer_js(){
$mh_options = mh_theme_options();
?>