add_section( 'ascetica_typography' , array( 'title' => __( 'Typography', 'ascetica' ), 'priority' => 30, ) ); /* Section: Custom CSS */ $wp_customize->add_section( 'ascetica_custom_css' , array( 'title' => __( 'Custom CSS', 'ascetica' ), 'priority' => 250, ) ); /* -------------- S E T T I N G S --------------- */ /* Setting: Font Family */ $wp_customize->add_setting( 'ascetica_font_family' , array( 'default' => 'Georgia', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'ascetica_font_family_sanitize' ) ); /* Setting: Font Size */ $wp_customize->add_setting( 'ascetica_font_size' , array( 'default' => '16', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'ascetica_font_size_sanitize' ) ); /* Setting: Link Color */ $wp_customize->add_setting( 'ascetica_link_color' , array( 'default' => '#bb2530', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'ascetica_link_color_sanitize' ) ); /* Setting: Custom CSS */ $wp_customize->add_setting( 'ascetica_custom_css' , array( 'default' => hybrid_get_setting( 'ascetica_custom_css' ) ? hybrid_get_setting( 'ascetica_custom_css' ) : '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'ascetica_custom_css_sanitize' ) ); /* -------------- C O N T R O L S --------------- */ /* Control: Font Family */ $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ascetica_font_family', array( 'label' => __( 'Font Family', 'ascetica' ), 'section' => 'ascetica_typography', 'settings' => 'ascetica_font_family', 'type' => 'select', 'choices' => array ( 'Georgia' => 'Georgia', 'PT Serif' => 'PT Serif', 'Bitter' => 'Bitter', 'Droid Serif' => 'Droid Serif', 'Helvetica' => 'Helvetica', 'Istok Web' => 'Istok Web', 'Arial' => 'Arial', 'Verdana' => 'Verdana', 'Lucida Sans Unicode' => 'Lucida Sans Unicode', 'Droid Sans' => 'Droid Sans' ), 'priority' => 1 ) ) ); /* Control: Font Size */ $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ascetica_font_size', array( 'label' => __( 'Font Size', 'ascetica' ), 'section' => 'ascetica_typography', 'settings' => 'ascetica_font_size', 'type' => 'select', 'choices' => array ( '17' => '18', '17' => '17', '16' => '16', '15' => '15', '14' => '14', '13' => '13', '12' => '12' ), 'priority' => 1 ) ) ); /* Control: Link Color */ $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ascetica-link-color', array( 'label' => __( 'Link Color', 'ascetica' ), 'section' => 'colors', 'settings' => 'ascetica_link_color', 'priority' => 1 ) ) ); /* Control: Custom CSS */ $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'ascetica-custom-css', array( 'label' => __( 'Custom CSS', 'ascetica' ), 'section' => 'ascetica_custom_css', 'settings' => 'ascetica_custom_css', 'priority' => 1 ) ) ); } /** * Sanitize the "Font Family" setting. * */ function ascetica_font_family_sanitize( $setting, $object ) { if ( 'ascetica_font_family' == $object->id ) $setting = wp_filter_nohtml_kses( $setting ); return $setting; } /** * Sanitize the "Font Size" setting. * */ function ascetica_font_size_sanitize( $setting, $object ) { if ( 'ascetica_font_size' == $object->id ) $setting = wp_filter_nohtml_kses( intval( $setting ) ); return $setting; } /** * Sanitize the "Link Color" setting. * */ function ascetica_link_color_sanitize( $setting, $object ) { if ( 'ascetica_link_color' == $object->id ) $setting = wp_filter_nohtml_kses( $setting ); return $setting; } /** * Sanitize the "Custom CSS" setting. * */ function ascetica_custom_css_sanitize( $setting, $object ) { if ( 'ascetica_custom_css' == $object->id ) $setting = wp_filter_nohtml_kses( $setting ); return $setting; } /** * Output settings CSS into the head. * */ function ascetica_customize_css() { ?>