Inventory_Presser_Slider::include_scripts( $instance )

Enqueues stylesheets and JavaScripts


Return Return

(void)


Top ↑

Source Source

File: includes/widget/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 = ' . wp_json_encode(
				array(
					'showcount' => $instance['showcount'] ?? 3,
				)
			),
			'before'
		);

	}