<?php
/**
 * Sewa Theme Customizer
 *
 * @package Canyon Themes
 * @subpackage Sewa
 */


/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
if (!function_exists('sewa_customize_register')) :
    function sewa_customize_register($wp_customize)
    {
        $wp_customize->get_setting('blogname')->transport         = 'refresh';
        $wp_customize->get_setting('blogdescription')->transport  = 'refresh';
        $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
        $wp_customize->get_setting( 'custom_logo' )->transport = 'refresh';
    
        if ( isset( $wp_customize->selective_refresh ) ) {
            $wp_customize->selective_refresh->add_partial( 'blogname', array(
                'selector'        => '.site-title a',
                'render_callback' => 'sewa_customize_partial_blogname',
            ) );
            $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
                'selector'        => '.site-description',
                'render_callback' => 'sewa_customize_partial_blogdescription',
            ) );
        }

        /*default variable used in setting*/
        $default = sewa_get_default_theme_options();

        /**
         * Customizer setting
         */
        require get_template_directory() . '/canyonthemes/core/customizer-core.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-customizer-function.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-sanitize.php';
        require get_template_directory() . '/canyonthemes/customizer/customizer.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-copy-right.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-theme-options.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-header-info-section.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-layout-design-options.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-color-options.php';
        require get_template_directory() . '/canyonthemes/customizer/sewa-single-page-options.php';

    }
    add_action('customize_register', 'sewa_customize_register');
endif;
/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */

if (!function_exists('sewa_customize_preview_js')) :
    function sewa_customize_preview_js()
    {
        wp_enqueue_script('sewa-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array('customize-preview'), '1.0.1', true);
    }
    add_action('customize_preview_init', 'sewa_customize_preview_js');

endif;