remove_section( 'themes' ); $wp_customize->remove_control( 'display_header_text' ); $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_section( 'static_front_page' )->panel = 'thbusiness_home_settings'; $wp_customize->get_section( 'background_image' )->panel = 'thbusiness_styling'; $wp_customize->get_section( 'header_image' )->panel = 'thbusiness_styling'; $wp_customize->get_section( 'colors' )->panel = 'thbusiness_styling'; /** * Header Settings Panel */ $wp_customize->add_panel( 'thbusiness_header_settings', array( 'title' => __( 'Header Settings', 'thbusiness' ), 'description' => __( 'Use this panel to set your header settings', 'thbusiness' ), 'priority' => 25, ) ); // Logo image $wp_customize->add_setting( 'site_logo', array( 'sanitize_callback' => 'thbusiness_sanitize_image' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'site_logo', array( 'label' => __( 'Site Logo', 'thbusiness' ), 'section' => 'title_tagline', 'settings' => 'site_logo', 'description' => __( 'Upload a logo for your website. Recommended height for your logo is 135px.', 'thbusiness' ), ) ) ); // Logo, title and description chooser $wp_customize->add_setting( 'site_title_option', array ( 'default' => 'text_only', 'sanitize_callback' => 'thbusiness_sanitize_logo_title_select', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'site_title_option', array( 'label' => __( 'Display site title / logo.', 'thbusiness' ), 'section' => 'title_tagline', 'type' => 'radio', 'description' => __( 'Choose your preferred option.', 'thbusiness' ), 'choices' => array ( 'text_only' => __( 'Display site title and description only.', 'thbusiness' ), 'logo_only' => __( 'Display site logo image only.', 'thbusiness' ), 'display_none' => __( 'Display none', 'thbusiness' ) ) ) ); // Site favicon $wp_customize->add_setting( 'site_favicon', array( 'sanitize_callback' => 'thbusiness_sanitize_image' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'site_favicon', array( 'label' => __( 'Upload a favicon', 'thbusiness' ), 'section' => 'title_tagline', 'settings' => 'site_favicon', 'description' => __( 'Upload a favicon for your website.', 'thbusiness' ), ) ) ); // Display site favicon? $wp_customize->add_setting( 'display_site_favicon', array( 'default' => false, 'sanitize_callback' => 'thbusiness_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_site_favicon', array( 'settings' => 'display_site_favicon', 'section' => 'title_tagline', 'type' => 'checkbox', 'label' => __( 'Display site favicon?', 'thbusiness' ), ) ); /** * General settings section. */ $wp_customize->add_section( 'thbusiness_general_settings', array( 'title' => __( 'General Settings', 'thbusiness' ), 'description' => __( 'Use this section to set general settings of the site.', 'thbusiness' ), 'priority' => 30, ) ); // Footer copyright text. $wp_customize->add_setting( 'footer_copyright_text', array( 'default' => sprintf( __( 'Copyright %s. All rights reserved.', 'thbusiness' ), esc_html( get_bloginfo( 'name' ) ) ), 'sanitize_callback' => 'thbusiness_sanitize_html' ) ); $wp_customize->add_control( 'footer_copyright_text', array( 'settings' => 'footer_copyright_text', 'section' => 'thbusiness_general_settings', 'type' => 'textarea', 'label' => __( 'Footer copyright text', 'thbusiness' ), 'description' => __( 'Copyright or other text to be displayed in the site footer. HTML allowed.', 'thbusiness' ) ) ); /** * Top bar section. */ $wp_customize->add_section( 'thbusiness_topbar_settings', array( 'title' => __( 'Top Bar Settings', 'thbusiness' ), 'priority' => 31, ) ); // Display topbar? $wp_customize->add_setting( 'display_topbar', array( 'default' => true, 'sanitize_callback' => 'thbusiness_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_topbar', array( 'settings' => 'display_topbar', 'section' => 'thbusiness_topbar_settings', 'type' => 'checkbox', 'label' => __( 'Display top bar?', 'thbusiness' ) ) ); $wp_customize->add_setting( 'telephone_text', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_html' ) ); $wp_customize->add_control( 'telephone_text', array( 'settings' => 'telephone_text', 'section' => 'thbusiness_topbar_settings', 'type' => 'text', 'label' => __( 'Call Us Text', 'thbusiness' ), ) ); $wp_customize->add_setting( 'telephone_number', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_nohtml' ) ); $wp_customize->add_control( 'telephone_number', array( 'settings' => 'telephone_number', 'section' => 'thbusiness_topbar_settings', 'type' => 'text', 'label' => __( 'Telephone Number', 'thbusiness' ), ) ); $wp_customize->add_setting( 'email_text', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_nohtml' ) ); $wp_customize->add_control( 'email_text', array( 'settings' => 'email_text', 'section' => 'thbusiness_topbar_settings', 'type' => 'text', 'label' => __( 'Email Text', 'thbusiness' ), ) ); $wp_customize->add_setting( 'email_address', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_email' ) ); $wp_customize->add_control( 'email_address', array( 'settings' => 'email_address', 'section' => 'thbusiness_topbar_settings', 'type' => 'email', 'label' => __( 'Email Address', 'thbusiness' ), ) ); // Topbar custom text. $wp_customize->add_setting( 'topbar_custom_text', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_nohtml' ) ); $wp_customize->add_control( 'topbar_custom_text', array( 'settings' => 'topbar_custom_text', 'section' => 'thbusiness_topbar_settings', 'type' => 'textarea', 'label' => __( 'Custom Text', 'thbusiness' ), 'description' => __( 'Add your custom text here.', 'thbusiness' ) ) ); /** * Home Settings section. */ $wp_customize->add_panel( 'thbusiness_home_settings', array( 'title' => __( 'Homepage Settings', 'thbusiness' ), 'description' => __( 'Use this panel to set your home page settings', 'thbusiness' ), 'priority' => 32, ) ); /** * Slider Section. */ $wp_customize->add_section( 'thbusiness_slider', array( 'title' => __( 'Homepage Slider', 'thbusiness' ), 'panel' => 'thbusiness_home_settings' ) ); // Display slider? $wp_customize->add_setting( 'display_slider', array( 'default' => true, 'sanitize_callback' => 'thbusiness_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_slider', array( 'settings' => 'display_slider', 'section' => 'thbusiness_slider', 'type' => 'checkbox', 'label' => __( 'Display slider on homepage ?', 'thbusiness' ) ) ); for ( $i=1; $i <= 5; $i++ ) { $wp_customize->add_setting( 'custom_slide_img_' . $i . '', array( 'sanitize_callback' => 'thbusiness_sanitize_image' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_slide_img_' . $i . '', array( 'label' => sprintf( __( 'Slide %d image', 'thbusiness' ), $i ), 'section' => 'thbusiness_slider', 'settings' => 'custom_slide_img_' . $i . '', ) ) ); $wp_customize->add_setting( 'custom_slide_title_' . $i . '', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_html' ) ); $wp_customize->add_control( 'custom_slide_title_' . $i . '', array( 'settings' => 'custom_slide_title_' . $i . '', 'section' => 'thbusiness_slider', 'type' => 'text', 'label' => sprintf( __( 'Slide %d title', 'thbusiness' ), $i ) ) ); $wp_customize->add_setting( 'custom_slide_description_' . $i . '', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_html' ) ); $wp_customize->add_control( 'custom_slide_description_' . $i . '', array( 'settings' => 'custom_slide_description_' . $i . '', 'section' => 'thbusiness_slider', 'type' => 'textarea', 'label' => sprintf( __( 'Slide %d description', 'thbusiness' ), $i ) ) ); $wp_customize->add_setting( 'custom_slide_url_' . $i . '', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'custom_slide_url_' . $i . '', array( 'settings' => 'custom_slide_url_' . $i . '', 'section' => 'thbusiness_slider', 'type' => 'text', 'label' => sprintf( __( 'Slide %d redirect url', 'thbusiness' ), $i ) ) ); $wp_customize->add_setting( 'custom_slide_button_text_' . $i . '', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_html' ) ); $wp_customize->add_control( 'custom_slide_button_text_' . $i . '', array( 'settings' => 'custom_slide_button_text_' . $i . '', 'section' => 'thbusiness_slider', 'type' => 'text', 'label' => sprintf( __( 'Slide %d button text', 'thbusiness' ), $i ) ) ); } /** * Styling Options. */ $wp_customize->add_panel( 'thbusiness_styling', array( 'title' => __( 'Site Styling', 'thbusiness' ), 'description' => __( 'Use this section to setup the homepage slider and featured posts.', 'thbusiness' ), 'priority' => 33, ) ); $wp_customize->add_setting( 'site_main_color', array( 'default' => '#eb5937', 'sanitize_callback' => 'thbusiness_sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'site_main_color', array( 'settings' => 'site_main_color', 'section' => 'colors', 'label' => __( 'Site Main Color', 'thbusiness' ), ) ) ); /** * Custom CSS section */ $wp_customize->add_section( 'thbusiness_custom_css', array( 'title' => __( 'Custom CSS', 'thbusiness' ), 'panel' => 'thbusiness_styling', 'priority' => 50 ) ); $wp_customize->add_setting( 'custom_css', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'thbusiness_sanitize_css' ) ); $wp_customize->add_control( 'custom_css', array( 'settings' => 'custom_css', 'section' => 'thbusiness_custom_css', 'type' => 'textarea', 'label' => __( 'Custom CSS', 'thbusiness' ), 'description' => __( 'Define custom CSS be used for your site. Do not enclose in script tags.', 'thbusiness' ), ) ); /** * Social Media */ $wp_customize->add_section( 'thbusiness_social_media', array( 'title' => __( 'Social Media', 'thbusiness' ), 'priority' => 34 ) ); $wp_customize->add_setting( 'display_social_icons', array( 'default' => false, 'sanitize_callback' => 'thbusiness_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_social_icons', array( 'settings' => 'display_social_icons', 'section' => 'thbusiness_social_media', 'type' => 'checkbox', 'label' => __( 'Display social icons?', 'thbusiness' ), ) ); $wp_customize->add_setting( 'social_media_text', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_nohtml' ) ); $wp_customize->add_control( 'social_media_text', array( 'settings' => 'social_media_text', 'section' => 'thbusiness_social_media', 'type' => 'text', 'label' => __( 'Follow Us Text', 'thbusiness' ), ) ); $wp_customize->add_setting( 'facebook_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'facebook_url', array( 'settings' => 'facebook_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Facebook URL', 'thbusiness' ), ) ); $wp_customize->add_setting( 'twitter_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'twitter_url', array( 'settings' => 'twitter_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Twitter URL', 'thbusiness' ), ) ); $wp_customize->add_setting( 'googleplus_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'googleplus_url', array( 'settings' => 'googleplus_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Google Plus URL', 'thbusiness' ), ) ); $wp_customize->add_setting( 'instagram_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'instagram_url', array( 'settings' => 'instagram_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Instagram Url', 'thbusiness' ), ) ); $wp_customize->add_setting( 'linkedin_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'linkedin_url', array( 'settings' => 'linkedin_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Linkedin URL', 'thbusiness' ), ) ); $wp_customize->add_setting( 'youtube_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'youtube_url', array( 'settings' => 'youtube_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Youtube URL', 'thbusiness' ), ) ); $wp_customize->add_setting( 'dribbble_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'dribbble_url', array( 'settings' => 'dribbble_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Dribbble URL', 'thbusiness' ), ) ); $wp_customize->add_setting( 'github_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'github_url', array( 'settings' => 'github_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Github URL', 'thbusiness' ), ) ); $wp_customize->add_setting( 'flickr_url', array( 'default' => '', 'sanitize_callback' => 'thbusiness_sanitize_url' ) ); $wp_customize->add_control( 'flickr_url', array( 'settings' => 'flickr_url', 'section' => 'thbusiness_social_media', 'type' => 'url', 'label' => __( 'Flickr URL', 'thbusiness' ), ) ); $wp_customize->add_section( 'thbusiness_pro_details', array( 'title' => __( 'THBusiness Pro', 'thbusiness' ), 'priority' => 120 ) ); $wp_customize->add_setting( 'thbusiness_pro_desc', array( 'sanitize_callback' => 'thbusiness_sanitize_html' ) ); $wp_customize->add_control( new Thbusiness_Custom_Content( $wp_customize, 'thbusiness_pro_desc', array( 'section' => 'thbusiness_pro_details', 'priority' => 20, 'label' => __( 'Do you want more features?', 'thbusiness' ), 'content' => __( 'Then consider buying Thbusiness Pro.