Inventory_Presser_Slider::include_scripts( $instance )

include_scripts


Description Description

Enqueues stylesheets and JavaScripts


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-widget-inventory-slider.php

	function include_scripts( $instance )
	{
		//Need flexslider scripts and styles
		wp_enqueue_style( 'flexslider' );
		wp_enqueue_style( 'invp-flexslider' );
		wp_enqueue_style( 'invp-slider' );

		//Spin-up script
		wp_enqueue_script( 'invp-slider' );
		//Provide one of the widget settings to JavaScript
		wp_add_inline_script( 'invp-slider', 'const widget_slider = ' . json_encode( array(
			'showcount' => $instance['showcount'],
		) ), 'before' );

	}