<?php 

if(!function_exists('vidall_slider_scripts')) :
    function vidall_slider_scripts () {
        $script_path = plugin_dir_url( __FILE__ );



        wp_enqueue_script( 'vidall_slider_script', $script_path . 'js/jquery.flexslider.js', 'jquery', '1.0', true );

        wp_register_script( 'vidall_slider_fire', $script_path . 'js/fire_flexslider.js', 'jquery', '1.0', true );

        wp_enqueue_style( 'vidall_slider_styles', $script_path . 'css/flexslider.css' );

         $animation = (get_theme_mod('flex_animation_settings','fade'));
         $speed = (get_theme_mod('flex_slide_speed', '7000'));
         $direction = (get_theme_mod('flex_slide_direction','horizontal'));
         $anispeed = (get_theme_mod('flex_slide_anispeed','1000'));
         $actionpause = (get_theme_mod('flex_slide_action_pause','1'));
         $pauseonhover = __(get_theme_mod('flex_slide_pause_hover','1'));
         $nav = (get_theme_mod('flex_nav','true'));
         $navpaging = (get_theme_mod('flex_nav_paging','true'));
         
    $config_array = array(
            'animations' => $animation,
            'speed' => $speed,
            'direction' => $direction,
            'anispeed' => $anispeed,
            'actionpause' => $actionpause,
            'pauseonhover' => $pauseonhover,
            'navigation' => $nav,
            'navigationpaging' => $navpaging
        );
 
    wp_localize_script('vidall_slider_fire', 'object_name', $config_array);
    
    wp_enqueue_script( 'vidall_slider_fire' );
 
}

    
    add_action('wp_enqueue_scripts', 'vidall_slider_scripts');
    endif;