<?php
/**
 * Trainify Theme Customizer
 *
 * @package MatrixAddons
 * @subpackage trainify
 * @since 1.0.0
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function trainify_customize_register($wp_customize)
{

    require_once trainify_file_directory('inc/customizer/upsell/trainify-upsell-section.php');
    require_once trainify_file_directory('inc/customizer/header/panel-header.php');
    require_once trainify_file_directory('inc/customizer/templates/panel-templates.php');
    require_once trainify_file_directory('inc/customizer/footer/panel-footer.php');
    require_once trainify_file_directory('inc/customizer/colors/panel-colors.php');
    require_once trainify_file_directory('/inc/customizer/homepage/panel-homepage.php');
    require_once trainify_file_directory('inc/customizer/options/panel-options.php');

}

add_action('customize_register', 'trainify_customize_register');


function trainify_customize_preview_init()
{
    $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';

    wp_enqueue_script('trainify_customizer', get_template_directory_uri() . '/assets/admin/js/customizer-script' . $min . '.js', array('customize-preview'), '20151215', true);
}

add_action('customize_preview_init', 'trainify_customize_preview_init');
