register_section_type( 'biz_growth_hub_lite_Customize_Section_Pro' ); // Register sections. $wp_customize->add_section( new biz_growth_hub_lite_Customize_Section_Pro( $wp_customize, 'theme_go_pro', array( 'priority' => 1, 'title' => esc_html__( 'Biz Growth Hub Pro', 'biz-growth-hub-lite' ), 'pro_text' => esc_html__( 'Upgrade To Pro', 'biz-growth-hub-lite' ), 'pro_url' => 'https://www.featherthemes.com/themes/wordpress-biz-growth-hub-pro-theme/', ) ) ); $wp_customize->add_section('biz_growth_hub_lite_header', array( 'title' => esc_html__('Header Phone and Email', 'biz-growth-hub-lite'), 'description' => '', 'priority' => 30, )); $wp_customize->add_section('biz_growth_hub_lite_social', array( 'title' => esc_html__('Social Section', 'biz-growth-hub-lite'), 'description' => '', 'priority' => 35, )); // ============================= // = Text Input phone number = // ============================= $wp_customize->add_setting('biz_growth_hub_lite_phone', array( 'default' => '', 'sanitize_callback' => 'biz_growth_hub_lite_sanitize_phone_number' )); $wp_customize->add_control('biz_growth_hub_lite_phone', array( 'label' => esc_html__('Phone Number', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_header', 'setting' => 'biz_growth_hub_lite_phone', 'type' => 'text' )); // ============================= // = Text Input Email = // ============================= $wp_customize->add_setting('biz_growth_hub_lite_address', array( 'default' => '', 'sanitize_callback' => 'sanitize_email' )); $wp_customize->add_control('biz_growth_hub_lite_address', array( 'label' => esc_html__('Email Address', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_header', 'setting' => 'biz_growth_hub_lite_address', 'type' => 'email' )); // ============================= // = Text Input facebook = // ============================= $wp_customize->add_setting('biz_growth_hub_lite_fb', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biz_growth_hub_lite_fb', array( 'label' => esc_html__('Facebook', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_social', 'setting' => 'biz_growth_hub_lite_fb', )); // ============================= // = Text Input Twitter = // ============================= $wp_customize->add_setting('biz_growth_hub_lite_twitter', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biz_growth_hub_lite_twitter', array( 'label' => esc_html__('Twitter', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_social', 'setting' => 'biz_growth_hub_lite_twitter', )); // ============================= // = Text Input youtube = // ============================= $wp_customize->add_setting('biz_growth_hub_lite_youtube', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biz_growth_hub_lite_youtube', array( 'label' => esc_html__('YouTube', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_social', 'setting' => 'biz_growth_hub_lite_youtube', )); // ============================= // = Text Input linkedin = // ============================= $wp_customize->add_setting('biz_growth_hub_lite_in', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('biz_growth_hub_lite_in', array( 'label' => esc_html__('Linkedin', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_social', 'setting' => 'biz_growth_hub_lite_in', )); // ============================= // = slider section = // ============================= $wp_customize->add_section('biz_growth_hub_lite_banner', array( 'title' => esc_html__('Home Banner Text', 'biz-growth-hub-lite'), 'description' => esc_html__('add home banner text here.','biz-growth-hub-lite'), 'priority' => 36, )); // Banner heading Text $wp_customize->add_setting('banner_heading',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('banner_heading',array( 'type' => 'text', 'label' => esc_html__('Add Banner heading here','biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_banner', 'setting' => 'banner_heading' )); // Banner heading Text // Banner heading Text $wp_customize->add_setting('banner_sub_heading',array( 'default' => null, 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('banner_sub_heading',array( 'type' => 'text', 'label' => esc_html__('Add Banner sub heading here','biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_banner', 'setting' => 'banner_sub_heading' )); // Banner heading Text // ============================= // = box section = // ============================= $wp_customize->add_section('biz_growth_hub_lite_box', array( 'title' => esc_html__('Resource Section', 'biz-growth-hub-lite'), 'description' => esc_html__('Upload image, it will auto crop with 400*250.','biz-growth-hub-lite'), 'priority' => 36, )); // Resource Section Small Heading (Subtitle) $wp_customize->add_setting('biz_growth_hub_lite_resources_subtitle', array( 'default' => 'OUR RESOURCES', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('biz_growth_hub_lite_resources_subtitle', array( 'type' => 'text', 'label' => esc_html__('Resource Section Subtitle', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_box', 'setting' => 'biz_growth_hub_lite_resources_subtitle', )); // Resource Section Main Heading $wp_customize->add_setting('biz_growth_hub_lite_resources_title', array( 'default' => 'Our Business Growth Resources', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('biz_growth_hub_lite_resources_title', array( 'type' => 'text', 'label' => esc_html__('Resource Section Title', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_box', 'setting' => 'biz_growth_hub_lite_resources_title', )); $wp_customize->add_setting('biz_growth_hub_lite_box1',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biz_growth_hub_lite_sanitize_page' )); $wp_customize->add_control('biz_growth_hub_lite_box1',array( 'type' => 'dropdown-pages', 'label' => esc_html__('Select page for Resource first:','biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_box' )); $wp_customize->add_setting('biz_growth_hub_lite_box2',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biz_growth_hub_lite_sanitize_page' )); $wp_customize->add_control('biz_growth_hub_lite_box2',array( 'type' => 'dropdown-pages', 'label' => esc_html__('Select page for Resource second:','biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_box' )); $wp_customize->add_setting('biz_growth_hub_lite_box3',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biz_growth_hub_lite_sanitize_page' )); $wp_customize->add_control('biz_growth_hub_lite_box3',array( 'type' => 'dropdown-pages', 'label' => esc_html__('Select page for Resource third:','biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_box' )); $wp_customize->add_setting('biz_growth_hub_lite_box4',array( 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biz_growth_hub_lite_sanitize_page' )); $wp_customize->add_control('biz_growth_hub_lite_box4',array( 'type' => 'dropdown-pages', 'label' => esc_html__('Select page for Resource fourth:','biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_box' )); // ============================= // = box section = // ============================= // ============================= // = Footer = // ============================= $wp_customize->add_section('biz_growth_hub_lite_footer', array( 'title' => esc_html__('Footer', 'biz-growth-hub-lite'), 'description' => '', 'priority' => 37, )); // Footer design and developed $wp_customize->add_setting('biz_growth_hub_lite_design', array( 'default' => '', 'sanitize_callback' => 'sanitize_textarea_field' )); $wp_customize->add_control('biz_growth_hub_lite_design', array( 'label' => esc_html__('Design and developed', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_footer', 'setting' => 'biz_growth_hub_lite_design', 'type' =>'textarea' )); // Footer copyright $wp_customize->add_setting('biz_growth_hub_lite_copyright', array( 'default' => '', 'sanitize_callback' => 'sanitize_textarea_field' )); $wp_customize->add_control('biz_growth_hub_lite_copyright', array( 'label' => esc_html__('Copyright', 'biz-growth-hub-lite'), 'section' => 'biz_growth_hub_lite_footer', 'setting' => 'biz_growth_hub_lite_copyright', 'type' =>'textarea' )); //layout setting $wp_customize->add_section('biz_growth_hub_lite_sidebar_layout', array( 'title' => esc_html__('Layout', 'biz-growth-hub-lite'), 'description' => esc_html__('Layout','biz-growth-hub-lite'), 'priority' => 36, )); //post layout setting $wp_customize->add_setting('biz_growth_hub_lite_custom_sidebar_post_layout', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biz_growth_hub_lite_layout_sanitize_select', 'default' => '', )); $wp_customize->add_control('biz_growth_hub_lite_custom_sidebar_post_layout', array( 'type' => 'select', 'section' => 'biz_growth_hub_lite_sidebar_layout', // Add a default or your own section 'label' => esc_html__('Select Post layout','biz-growth-hub-lite'), 'description' => esc_html__('Select Layout','biz-growth-hub-lite'), 'choices' => custom_biz_growth_hub_lite_layout(), )); //page layout setting – default full width for inner pages $wp_customize->add_setting('biz_growth_hub_lite_custom_sidebar_page_layout', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biz_growth_hub_lite_layout_sanitize_select', 'default' => 'sitefull', )); $wp_customize->add_control('biz_growth_hub_lite_custom_sidebar_page_layout', array( 'type' => 'select', 'section' => 'biz_growth_hub_lite_sidebar_layout', // Add a default or your own section 'label' => esc_html__('Select Page layout','biz-growth-hub-lite'), 'description' => esc_html__('Select Layout','biz-growth-hub-lite'), 'choices' => custom_biz_growth_hub_lite_layout(), )); //homepage layout setting $wp_customize->add_setting('biz_growth_hub_lite_custom_sidebar_homepage_layout', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biz_growth_hub_lite_layout_sanitize_select', 'default' => '', )); $wp_customize->add_control('biz_growth_hub_lite_custom_sidebar_homepage_layout', array( 'type' => 'select', 'section' => 'biz_growth_hub_lite_sidebar_layout', // Add a default or your own section 'label' => esc_html__('Select HomePage layout','biz-growth-hub-lite'), 'description' => esc_html__('Select Layout','biz-growth-hub-lite'), 'choices' => custom_biz_growth_hub_lite_layout(), )); } add_action('customize_register', 'biz_growth_hub_lite_customize_register'); function biz_growth_hub_lite_sanitize_phone_number( $phone ) { return preg_replace( '/[^\d+]/', '', $phone ); } function custom_biz_growth_hub_lite_layout() { $layout = array('singleright' => esc_html__('Right Sidebar', 'biz-growth-hub-lite'), 'singleleft' => esc_html__('Left Sidebar', 'biz-growth-hub-lite'), 'sitefull' => esc_html__('Full Width', 'biz-growth-hub-lite') ); return $layout; } function biz_growth_hub_lite_layout_sanitize_select($input) { $valid = custom_biz_growth_hub_lite_layout(); if (array_key_exists($input, $valid)) { return $input; } else { return ''; } }