remove_control('header_textcolor'); $wp_customize->remove_control('display_header_text'); $wp_customize->get_section('header_image')->panel = 'biogenic_option_panel'; $wp_customize->get_section('header_image')->priority = '152'; } add_action('customize_register', 'biogenic_customize_register'); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function biogenic_customize_preview_js() { wp_enqueue_script('biogenic_customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), '20151215', true); } add_action('customize_preview_init', 'biogenic_customize_preview_js'); /* Add Kirki to Customizer Panel */ $biogenic_theme_options = biogenic_theme_options(); biogenic_Kirki::add_config('biogenic_theme', array( 'capability' => 'edit_theme_options', 'option_type' => 'option', 'option_name' => 'biogenic_theme_options', )); biogenic_Kirki::add_panel('biogenic_option_panel', array( 'priority' => 10, 'title' => __('Biogenic Theme Options', 'biogenic'), 'description' => __('Here you can customize all your Theme Options', 'biogenic'), )); biogenic_Kirki::add_field('biogenic_theme', array( 'type' => 'slider', 'settings' => 'header_height', 'section' => 'header_image', 'label' => __('Header Height', 'biogenic'), 'default' => $biogenic_theme_options['header_height'], 'priority' => 20, 'sanitize_callback' => 'biogenic_sanitize_number', 'choices' => array('min' => '100', 'max' => '500', 'step' => '10'), 'output' => array( array( 'element' => '.header-image', 'property' => 'height', 'units' => 'px', ), ), )); /* Top Header Options */ biogenic_Kirki::add_section('top_header', array( 'title' => __('Top Header Options', 'biogenic'), 'panel' => 'biogenic_option_panel', 'priority' => 100, 'capability' => 'edit_theme_options', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'header_topbar_color', 'label' => __('Header Top Bar Color', 'biogenic'), 'description' => __('Change Top Header Background Color', 'biogenic'), 'section' => 'top_header', 'type' => 'color', 'priority' => 9, 'default' => $biogenic_theme_options['header_topbar_color'], 'sanitize_callback' => 'biogenic_sanitize_color', 'output' => array( array( 'element' => '.top-header', 'property' => 'background-color', ), ), )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_text_enable', 'label' => __('Enable Text in Top Header', 'biogenic'), 'description' => __('Show/Hide Text in Top Header', 'biogenic'), 'section' => 'top_header', 'type' => 'switch', 'priority' => 10, 'default' => $biogenic_theme_options['top_header_text_enable'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_text', 'label' => __('Top Header Text', 'biogenic'), 'description' => __('Change Top Header Text', 'biogenic'), 'section' => 'top_header', 'type' => 'text', 'priority' => 11, 'default' => $biogenic_theme_options['top_header_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_text_font_size', 'label' => __('Top Header Text Font Size', 'biogenic'), 'section' => 'top_header', 'type' => 'slider', 'priority' => 12, 'default' => $biogenic_theme_options['top_header_text_font_size'], 'choices' => array( 'max' => 36, 'min' => 10, 'step' => 2, ), 'output' => array( array( 'element' => '.top-header-text a', 'property' => 'font-size', 'units' => 'px', ), ), 'sanitize_callback' => 'biogenic_sanitize_number', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_text_spacing', 'label' => __('Top Header Text Spacing', 'biogenic'), 'section' => 'top_header', 'type' => 'slider', 'priority' => 13, 'default' => $biogenic_theme_options['top_header_text_spacing'], 'choices' => array( 'max' => 50, 'min' => 0, 'step' => 1, ), 'output' => array( array( 'element' => '.top-header-text', 'property' => 'padding', 'units' => 'px', ), ), 'sanitize_callback' => 'biogenic_sanitize_number', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_social_icons', 'label' => __('Enable Social Icons in Top Header', 'biogenic'), 'description' => __('Show/Hide social icons in header', 'biogenic'), 'section' => 'top_header', 'type' => 'switch', 'priority' => 14, 'default' => $biogenic_theme_options['top_header_social_icons'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_social_font_size', 'label' => __('Top Social Icon Size', 'biogenic'), 'section' => 'top_header', 'type' => 'slider', 'priority' => 15, 'default' => $biogenic_theme_options['top_social_font_size'], 'choices' => array( 'max' => 36, 'min' => 10, 'step' => 2, ), 'output' => array( array( 'element' => '.top-socials', 'property' => 'font-size', 'units' => 'px', ), ), 'sanitize_callback' => 'biogenic_sanitize_number', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_social_spacing', 'label' => __('Top Social Icon Spacing', 'biogenic'), 'section' => 'top_header', 'type' => 'slider', 'priority' => 16, 'default' => $biogenic_theme_options['top_social_spacing'], 'choices' => array( 'max' => 50, 'min' => 0, 'step' => 1, ), 'output' => array( array( 'element' => '.top-socials', 'property' => 'padding', 'units' => 'px', ), ), 'sanitize_callback' => 'biogenic_sanitize_number', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'social_facebook_link', 'label' => __('Facebook Profile URL', 'biogenic'), 'section' => 'top_header', 'type' => 'url', 'priority' => 17, 'default' => $biogenic_theme_options['social_facebook_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'social_twitter_link', 'label' => __('Twitter Profile URL', 'biogenic'), 'section' => 'top_header', 'type' => 'url', 'priority' => 18, 'default' => $biogenic_theme_options['social_twitter_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'social_google_plus_link', 'label' => __('Google+ Profile URL', 'biogenic'), 'section' => 'top_header', 'type' => 'url', 'priority' => 19, 'default' => $biogenic_theme_options['social_google_plus_link'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'social_youtube_link', 'label' => __('YouTube URL', 'biogenic'), 'section' => 'top_header', 'type' => 'url', 'priority' => 20, 'default' => $biogenic_theme_options['social_youtube_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_logo', 'label' => __('Enable Navbar Logo', 'biogenic'), 'description' => __('Show/Hide Logo in Top Header', 'biogenic'), 'section' => 'top_header', 'type' => 'switch', 'priority' => 21, 'default' => $biogenic_theme_options['top_header_logo'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'upload_image_logo', 'label' => __('Upload Navbar logo image', 'biogenic'), 'section' => 'top_header', 'type' => 'image', 'priority' => 22, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'logo_height', 'label' => __('Navbar logo height (px)', 'biogenic'), 'section' => 'top_header', 'type' => 'slider', 'priority' => 23, 'default' => $biogenic_theme_options['logo_height'], 'choices' => array( 'max' => 100, 'min' => 30, 'step' => 1, ), 'output' => array( array( 'element' => '.top-header-logo img', 'property' => 'height', 'units' => 'px', ), ), 'sanitize_callback' => 'biogenic_sanitize_number', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'logo_width', 'label' => __('Navbar logo width (px)', 'biogenic'), 'section' => 'top_header', 'type' => 'slider', 'priority' => 24, 'default' => $biogenic_theme_options['logo_width'], 'choices' => array( 'max' => 250, 'min' => 50, 'step' => 1, ), 'output' => array( array( 'element' => '.top-header-logo img', 'property' => 'width', 'units' => 'px', ), ), 'sanitize_callback' => 'biogenic_sanitize_number', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'logo_top_spacing', 'label' => __('Logo Top Spacing', 'biogenic'), 'section' => 'top_header', 'type' => 'slider', 'priority' => 25, 'default' => $biogenic_theme_options['logo_top_spacing'], 'choices' => array( 'max' => 50, 'min' => 0, 'step' => 1, ), 'output' => array( array( 'element' => '.top-header-logo', 'property' => 'padding', 'units' => 'px', ), ), 'sanitize_callback' => 'biogenic_sanitize_number', )); /* Header Hero Options */ biogenic_Kirki::add_section('header_hero', array( 'title' => __('Header Hero Options', 'biogenic'), 'panel' => 'biogenic_option_panel', 'priority' => 150, 'capability' => 'edit_theme_options', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_hero', 'label' => __('Enable Top Header Hero', 'biogenic'), 'description' => __('Show/Hide Header Hero', 'biogenic'), 'section' => 'header_hero', 'type' => 'switch', 'priority' => 10, 'default' => $biogenic_theme_options['top_header_hero'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'upload_hero_image', 'label' => __('Change Hero Image', 'biogenic'), 'section' => 'header_hero', 'type' => 'image', 'priority' => 11, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_hero_text1', 'label' => __('Header Hero Text Line 1', 'biogenic'), 'section' => 'header_hero', 'type' => 'text', 'priority' => 12, 'default' => $biogenic_theme_options['top_header_hero_text1'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_hero_text2', 'label' => __('Header Hero Text Line 2', 'biogenic'), 'section' => 'header_hero', 'type' => 'text', 'priority' => 13, 'default' => $biogenic_theme_options['top_header_hero_text2'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_hero_button1_text', 'label' => __('Header Hero Button 1 Label', 'biogenic'), 'section' => 'header_hero', 'type' => 'text', 'priority' => 14, 'default' => $biogenic_theme_options['top_header_hero_button1_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_hero_button1_link', 'label' => __('Header Hero Button 1 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'header_hero', 'type' => 'text', 'priority' => 15, 'default' => $biogenic_theme_options['top_header_hero_button1_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_hero_button2_text', 'label' => __('Header Hero Button 2 Label', 'biogenic'), 'section' => 'header_hero', 'type' => 'text', 'priority' => 16, 'default' => $biogenic_theme_options['top_header_hero_button2_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'top_header_hero_button2_link', 'label' => __('Header Hero Button 2 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'header_hero', 'type' => 'text', 'priority' => 17, 'default' => $biogenic_theme_options['top_header_hero_button2_link'], 'sanitize_callback' => 'esc_url', )); /* Welcome Section */ biogenic_Kirki::add_section('welcome_section', array( 'title' => __('Welcome Section', 'biogenic'), 'panel' => 'biogenic_option_panel', 'priority' => 155, 'capability' => 'edit_theme_options', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'welcome_section_enable', 'label' => __('Enable Welcome Section', 'biogenic'), 'description' => __('Show/Hide Welcome Section', 'biogenic'), 'section' => 'welcome_section', 'type' => 'switch', 'priority' => 9, 'default' => $biogenic_theme_options['welcome_section_enable'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'welcome_section_bg_color', 'label' => __('Welcome Section Background Color', 'biogenic'), 'section' => 'welcome_section', 'type' => 'color', 'priority' => 10, 'default' => $biogenic_theme_options['welcome_section_bg_color'], 'sanitize_callback' => 'biogenic_sanitize_color', 'output' => array( array( 'element' => '.welcome-section', 'property' => 'background-color', ), ), )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'welcome_section_title', 'label' => __('Welcome Section Title', 'biogenic'), 'section' => 'welcome_section', 'type' => 'text', 'priority' => 11, 'default' => $biogenic_theme_options['welcome_section_title'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'welcome_section_text', 'label' => __('Welcome Section Text', 'biogenic'), 'section' => 'welcome_section', 'type' => 'textarea', 'priority' => 12, 'default' => $biogenic_theme_options['welcome_section_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); /* Services Section */ biogenic_Kirki::add_section('services_section', array( 'title' => __('Services Section', 'biogenic'), 'panel' => 'biogenic_option_panel', 'priority' => 160, 'capability' => 'edit_theme_options', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_enable', 'label' => __('Enable Services Section', 'biogenic'), 'description' => __('Show/Hide Services Section', 'biogenic'), 'section' => 'services_section', 'type' => 'switch', 'priority' => 8, 'default' => $biogenic_theme_options['services_section_enable'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_bg_color', 'label' => __('Services Section Background Color', 'biogenic'), 'section' => 'services_section', 'type' => 'color', 'priority' => 9, 'default' => $biogenic_theme_options['services_section_bg_color'], 'sanitize_callback' => 'biogenic_sanitize_color', 'output' => array( array( 'element' => '.services-section', 'property' => 'background-color', ), ), )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_title', 'label' => __('Services Section Main Title', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 10, 'default' => $biogenic_theme_options['services_section_title'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_1_link', 'label' => __('Services Section 1 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'services_section', 'type' => 'url', 'priority' => 11, 'default' => $biogenic_theme_options['services_section_1_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_1_icon', 'label' => __('Services Section 1 Icon', 'biogenic'), 'description' => __('Use any Font-Awesome Icon (fa-xyz)', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 12, 'default' => $biogenic_theme_options['services_section_1_icon'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_1_subtitle', 'label' => __('Services Section 1 SubTitle', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 13, 'default' => $biogenic_theme_options['services_section_1_subtitle'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_1_text', 'label' => __('Services Section 1 Text', 'biogenic'), 'section' => 'services_section', 'type' => 'textarea', 'priority' => 14, 'default' => $biogenic_theme_options['services_section_1_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_2_link', 'label' => __('Services Section 2 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'services_section', 'type' => 'url', 'priority' => 15, 'default' => $biogenic_theme_options['services_section_2_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_2_icon', 'label' => __('Services Section 2 Icon', 'biogenic'), 'description' => __('Use any Font-Awesome Icon (fa-xyz)', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 16, 'default' => $biogenic_theme_options['services_section_2_icon'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_2_subtitle', 'label' => __('Services Section 2 SubTitle', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 17, 'default' => $biogenic_theme_options['services_section_2_subtitle'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_2_text', 'label' => __('Services Section 2 Text', 'biogenic'), 'section' => 'services_section', 'type' => 'textarea', 'priority' => 18, 'default' => $biogenic_theme_options['services_section_2_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_3_link', 'label' => __('Services Section 3 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'services_section', 'type' => 'url', 'priority' => 19, 'default' => $biogenic_theme_options['services_section_3_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_3_icon', 'label' => __('Services Section 3 Icon', 'biogenic'), 'description' => __('Use any Font-Awesome Icon (fa-xyz)', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 20, 'default' => $biogenic_theme_options['services_section_3_icon'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_3_subtitle', 'label' => __('Services Section 3 SubTitle', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 21, 'default' => $biogenic_theme_options['services_section_3_subtitle'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_3_text', 'label' => __('Services Section 3 Text', 'biogenic'), 'section' => 'services_section', 'type' => 'textarea', 'priority' => 22, 'default' => $biogenic_theme_options['services_section_3_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_4_link', 'label' => __('Services Section 4 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'services_section', 'type' => 'url', 'priority' => 23, 'default' => $biogenic_theme_options['services_section_4_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_4_icon', 'label' => __('Services Section 4 Icon', 'biogenic'), 'description' => __('Use any Font-Awesome Icon (fa-xyz)', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 24, 'default' => $biogenic_theme_options['services_section_4_icon'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_4_subtitle', 'label' => __('Services Section 4 SubTitle', 'biogenic'), 'section' => 'services_section', 'type' => 'text', 'priority' => 25, 'default' => $biogenic_theme_options['services_section_4_subtitle'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'services_section_4_text', 'label' => __('Services Section 4 Text', 'biogenic'), 'section' => 'services_section', 'type' => 'textarea', 'priority' => 26, 'default' => $biogenic_theme_options['services_section_4_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); /* Team Section */ biogenic_Kirki::add_section('team_section', array( 'title' => __('Team Section', 'biogenic'), 'panel' => 'biogenic_option_panel', 'priority' => 165, 'capability' => 'edit_theme_options', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_enable', 'label' => __('Enable Team Section', 'biogenic'), 'description' => __('Show/Hide Team Section', 'biogenic'), 'section' => 'team_section', 'type' => 'switch', 'priority' => 9, 'default' => $biogenic_theme_options['team_section_enable'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_bg_color', 'label' => __('Team Section Background Color', 'biogenic'), 'section' => 'team_section', 'type' => 'color', 'priority' => 10, 'default' => $biogenic_theme_options['team_section_bg_color'], 'sanitize_callback' => 'biogenic_sanitize_color', 'output' => array( array( 'element' => '.team-section', 'property' => 'background-color', ), ), )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_title', 'label' => __('Team Section Title', 'biogenic'), 'section' => 'team_section', 'type' => 'text', 'priority' => 11, 'default' => $biogenic_theme_options['team_section_title'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_1_link', 'label' => __('Team Section 1 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'team_section', 'type' => 'url', 'priority' => 12, 'default' => $biogenic_theme_options['team_section_1_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_1_image', 'label' => __('Change Team Member 1 Image', 'biogenic'), 'description' => __('Image should be 225x225 pixels', 'biogenic'), 'section' => 'team_section', 'type' => 'image', 'priority' => 13, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_1_name', 'label' => __('Team Memeber 1 Name', 'biogenic'), 'section' => 'team_section', 'type' => 'text', 'priority' => 14, 'default' => $biogenic_theme_options['team_section_1_name'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_1_position', 'label' => __('Team Memeber 1 Position/Jobtitle', 'biogenic'), 'section' => 'team_section', 'type' => 'text', 'priority' => 15, 'default' => $biogenic_theme_options['team_section_1_position'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_2_link', 'label' => __('Team Section 2 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'team_section', 'type' => 'url', 'priority' => 16, 'default' => $biogenic_theme_options['team_section_2_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_2_image', 'label' => __('Change Team Member 2 Image', 'biogenic'), 'description' => __('Image should be 225x225 pixels', 'biogenic'), 'section' => 'team_section', 'type' => 'image', 'priority' => 17, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_2_name', 'label' => __('Team Memeber 2 Name', 'biogenic'), 'section' => 'team_section', 'type' => 'text', 'priority' => 18, 'default' => $biogenic_theme_options['team_section_2_name'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_2_position', 'label' => __('Team Memeber 2 Position/Jobtitle', 'biogenic'), 'section' => 'team_section', 'type' => 'text', 'priority' => 19, 'default' => $biogenic_theme_options['team_section_2_position'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_3_link', 'label' => __('Team Section 3 Link', 'biogenic'), 'description' => __('Use full path (ex: http://mysite.com/blog)', 'biogenic'), 'section' => 'team_section', 'type' => 'url', 'priority' => 20, 'default' => $biogenic_theme_options['team_section_3_link'], 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_3_image', 'label' => __('Change Team Member 3 Image', 'biogenic'), 'description' => __('Image should be 225x225 pixels', 'biogenic'), 'section' => 'team_section', 'type' => 'image', 'priority' => 21, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_3_name', 'label' => __('Team Memeber 3 Name', 'biogenic'), 'section' => 'team_section', 'type' => 'text', 'priority' => 22, 'default' => $biogenic_theme_options['team_section_3_name'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_3_position', 'label' => __('Team Memeber 3 Position/Jobtitle', 'biogenic'), 'section' => 'team_section', 'type' => 'text', 'priority' => 23, 'default' => $biogenic_theme_options['team_section_3_position'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'team_section_summary', 'label' => __('Team Section Summary', 'biogenic'), 'description' => __('Change Team Section Summary', 'biogenic'), 'section' => 'team_section', 'type' => 'textarea', 'priority' => 24, 'default' => $biogenic_theme_options['team_section_summary'], 'sanitize_callback' => 'biogenic_sanitize_text', )); /* Testimonials Section */ biogenic_Kirki::add_section('testimonials_section', array( 'title' => __('Testimonials Section', 'biogenic'), 'panel' => 'biogenic_option_panel', 'priority' => 170, 'capability' => 'edit_theme_options', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_enable', 'label' => __('Enable Testimonials Section', 'biogenic'), 'description' => __('Show/Hide Testimonials Section', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'switch', 'priority' => 9, 'default' => $biogenic_theme_options['testimonials_section_enable'], 'sanitize_callback' => 'biogenic_sanitize_checkbox', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_bg_color', 'label' => __('Testimonials Section Background Color', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'color', 'priority' => 10, 'default' => $biogenic_theme_options['testimonials_section_bg_color'], 'sanitize_callback' => 'biogenic_sanitize_color', 'output' => array( array( 'element' => '.testimonials-section', 'property' => 'background-color', ), ), )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_title', 'label' => __('Testimonials Section Title', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'text', 'priority' => 11, 'default' => $biogenic_theme_options['testimonials_section_title'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_1_text', 'label' => __('Testimonials Section 1 Text', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'textarea', 'priority' => 12, 'default' => $biogenic_theme_options['testimonials_section_1_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_1_name', 'label' => __('Testimonials Section 1 Client Name', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'text', 'priority' => 13, 'default' => $biogenic_theme_options['testimonials_section_1_name'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_1_image', 'label' => __('Change Testimonial Client 1 Image', 'biogenic'), 'description' => __('Image should be 75x75 pixels', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'image', 'priority' => 14, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_2_text', 'label' => __('Testimonials Section 2 Text', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'textarea', 'priority' => 15, 'default' => $biogenic_theme_options['testimonials_section_2_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_2_name', 'label' => __('Testimonials Section 2 Client Name', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'text', 'priority' => 16, 'default' => $biogenic_theme_options['testimonials_section_2_name'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_2_image', 'label' => __('Change Testimonial Client 2 Image', 'biogenic'), 'description' => __('Image should be 75x75 pixels', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'image', 'priority' => 17, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_3_text', 'label' => __('Testimonials Section 3 Text', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'textarea', 'priority' => 18, 'default' => $biogenic_theme_options['testimonials_section_3_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_3_name', 'label' => __('Testimonials Section 3 Client Name', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'text', 'priority' => 19, 'default' => $biogenic_theme_options['testimonials_section_3_name'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_3_image', 'label' => __('Change Testimonial Client 3 Image', 'biogenic'), 'description' => __('Image should be 75x75 pixels', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'image', 'priority' => 20, 'sanitize_callback' => 'esc_url', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_4_text', 'label' => __('Testimonials Section 4 Text', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'textarea', 'priority' => 21, 'default' => $biogenic_theme_options['testimonials_section_4_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_4_name', 'label' => __('Testimonials Section 4 Client Name', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'text', 'priority' => 22, 'default' => $biogenic_theme_options['testimonials_section_4_name'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'testimonials_section_4_image', 'label' => __('Change Testimonial Client 4 Image', 'biogenic'), 'description' => __('Image should be 75x75 pixels', 'biogenic'), 'section' => 'testimonials_section', 'type' => 'image', 'priority' => 23, 'sanitize_callback' => 'esc_url', )); /* footer options */ biogenic_Kirki::add_section('footer_sec', array( 'title' => __('Footer Options', 'biogenic'), 'panel' => 'biogenic_option_panel', 'priority' => 300, 'capability' => 'edit_theme_options', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'footer_copyright', 'label' => __('Copyright Text', 'biogenic'), 'section' => 'footer_sec', 'type' => 'text', 'priority' => 10, 'default' => $biogenic_theme_options['footer_copyright'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'developed_by_text', 'label' => __('Developed by Text', 'biogenic'), 'section' => 'footer_sec', 'type' => 'text', 'priority' => 10, 'default' => $biogenic_theme_options['developed_by_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'developed_by_link_text', 'label' => __('Link Text', 'biogenic'), 'section' => 'footer_sec', 'type' => 'text', 'priority' => 10, 'default' => $biogenic_theme_options['developed_by_link_text'], 'sanitize_callback' => 'biogenic_sanitize_text', )); biogenic_Kirki::add_field('biogenic_theme', array( 'settings' => 'developed_by_link', 'label' => __('Developed by Link', 'biogenic'), 'section' => 'footer_sec', 'type' => 'url', 'priority' => 10, 'default' => $biogenic_theme_options['developed_by_link'], 'sanitize_callback' => 'esc_url', )); function biogenic_sanitize_text($input) { return wp_kses_post(force_balance_tags($input)); } function biogenic_sanitize_checkbox($checked) { return ((isset($checked) && (true == $checked || 'on' == $checked)) ? true : false); } /** * Sanitize number options */ function biogenic_sanitize_number($value) { if (is_array($value)) { foreach ($value as $key => $val) { $v[$key] = is_numeric($val) ? $val : intval($val); } return $v; } else { return (is_numeric($value)) ? $value : intval($value); } } function biogenic_sanitize_selected($value) { if ($value[0] == '') { return $value = ''; } else { return wp_kses_post($value); } } function biogenic_sanitize_color($color) { if ($color == "transparent") { return $color; } $named = json_decode('{"transparent":"transparent", "aliceblue":"#f0f8ff","antiquewhite":"#faebd7","aqua":"#00ffff","aquamarine":"#7fffd4","azure":"#f0ffff", "beige":"#f5f5dc","bisque":"#ffe4c4","black":"#000000","blanchedalmond":"#ffebcd","blue":"#0000ff","blueviolet":"#8a2be2","brown":"#a52a2a","burlywood":"#deb887", "cadetblue":"#5f9ea0","chartreuse":"#7fff00","chocolate":"#d2691e","coral":"#ff7f50","cornflowerblue":"#6495ed","cornsilk":"#fff8dc","crimson":"#dc143c","cyan":"#00ffff", "darkblue":"#00008b","darkcyan":"#008b8b","darkgoldenrod":"#b8860b","darkgray":"#a9a9a9","darkgreen":"#006400","darkkhaki":"#bdb76b","darkmagenta":"#8b008b","darkolivegreen":"#556b2f", "darkorange":"#ff8c00","darkorchid":"#9932cc","darkred":"#8b0000","darksalmon":"#e9967a","darkseagreen":"#8fbc8f","darkslateblue":"#483d8b","darkslategray":"#2f4f4f","darkturquoise":"#00ced1", "darkviolet":"#9400d3","deeppink":"#ff1493","deepskyblue":"#00bfff","dimgray":"#696969","dodgerblue":"#1e90ff", "firebrick":"#b22222","floralwhite":"#fffaf0","forestgreen":"#228b22","fuchsia":"#ff00ff", "gainsboro":"#dcdcdc","ghostwhite":"#f8f8ff","gold":"#ffd700","goldenrod":"#daa520","gray":"#808080","green":"#008000","greenyellow":"#adff2f", "honeydew":"#f0fff0","hotpink":"#ff69b4", "indianred ":"#cd5c5c","indigo ":"#4b0082","ivory":"#fffff0","khaki":"#f0e68c", "lavender":"#e6e6fa","lavenderblush":"#fff0f5","lawngreen":"#7cfc00","lemonchiffon":"#fffacd","lightblue":"#add8e6","lightcoral":"#f08080","lightcyan":"#e0ffff","lightgoldenrodyellow":"#fafad2", "lightgrey":"#d3d3d3","lightgreen":"#90ee90","lightpink":"#ffb6c1","lightsalmon":"#ffa07a","lightseagreen":"#20b2aa","lightskyblue":"#87cefa","lightslategray":"#778899","lightsteelblue":"#b0c4de", "lightyellow":"#ffffe0","lime":"#00ff00","limegreen":"#32cd32","linen":"#faf0e6", "magenta":"#ff00ff","maroon":"#800000","mediumaquamarine":"#66cdaa","mediumblue":"#0000cd","mediumorchid":"#ba55d3","mediumpurple":"#9370d8","mediumseagreen":"#3cb371","mediumslateblue":"#7b68ee", "mediumspringgreen":"#00fa9a","mediumturquoise":"#48d1cc","mediumvioletred":"#c71585","midnightblue":"#191970","mintcream":"#f5fffa","mistyrose":"#ffe4e1","moccasin":"#ffe4b5", "navajowhite":"#ffdead","navy":"#000080", "oldlace":"#fdf5e6","olive":"#808000","olivedrab":"#6b8e23","orange":"#ffa500","orangered":"#ff4500","orchid":"#da70d6", "palegoldenrod":"#eee8aa","palegreen":"#98fb98","paleturquoise":"#afeeee","palevioletred":"#d87093","papayawhip":"#ffefd5","peachpuff":"#ffdab9","peru":"#cd853f","pink":"#ffc0cb","plum":"#dda0dd","powderblue":"#b0e0e6","purple":"#800080", "red":"#ff0000","rosybrown":"#bc8f8f","royalblue":"#4169e1", "saddlebrown":"#8b4513","salmon":"#fa8072","sandybrown":"#f4a460","seagreen":"#2e8b57","seashell":"#fff5ee","sienna":"#a0522d","silver":"#c0c0c0","skyblue":"#87ceeb","slateblue":"#6a5acd","slategray":"#708090","snow":"#fffafa","springgreen":"#00ff7f","steelblue":"#4682b4", "tan":"#d2b48c","teal":"#008080","thistle":"#d8bfd8","tomato":"#ff6347","turquoise":"#40e0d0", "violet":"#ee82ee", "wheat":"#f5deb3","white":"#ffffff","whitesmoke":"#f5f5f5", "yellow":"#ffff00","yellowgreen":"#9acd32"}', true); if (isset($named[strtolower($color)])) { /* A color name was entered instead of a Hex Value, convert and send back */ return $named[strtolower($color)]; } $color = str_replace('#', '', $color); if (strlen($color) == 3) { $color = $color . $color; } if (preg_match('/^[a-f0-9]{6}$/i', $color)) { return '#' . $color; } //$this->error = $this->field; return false; } function biogenic_sanitize_textarea($value) { return wp_kses_post(force_balance_tags($value)); }