<?php 
/***
 * Custom Slider Parameters
 *
 * Passing Variables from custom Theme Options to the javascript files
 * of featured content slider. 
 *
 */
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
// Passing Variables to Featured Content Slider ( js/slider.js)
add_action('wp_enqueue_scripts', 'pmthemes_custom_jscript_slider');

if ( ! function_exists( 'pmthemes_custom_jscript_slider' ) ):
function pmthemes_custom_jscript_slider() { 
	
	// Get Theme Options from Database
	$theme_options = pmthemes_theme_options();
	
	// Set Parameters array
	$params = array();
	
	// Define Slider Animation
	if( isset($theme_options['slider_animation']) ) :
		$params['animation'] = esc_js($theme_options['slider_animation']);
	endif;
	
	// Passing Parameters to Javascript
	wp_localize_script( 'pmthemes-jquery-frontpage_slider', 'pmthemes_slider_params', $params );
}
endif;