yanknudtskov
8/5/2014 - 10:19 AM

Enqueue IRIS in WordPress editor

Enqueue IRIS in WordPress editor

<?php
function load_mc_iris() {
		if (wp_script_is( 'iris', 'enqueued' )) {
			return; // if it's already enqueued, don't enqueue it again.
		
		} else { // since it's NOT enqueued, let's enqueue it
		
		wp_enqueue_script(
			'iris', //iris.js handle
			admin_url( 'js/iris.min.js' ), //path to wordpress iris file
			array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), //these must load BEFORE iris (i.e. "dependencies)
			false, // don't load it in the footer
			1 // priority
			);
		}
	}
	// add this only on the backend
	add_action( 'admin_enqueue_scripts', 'load_mc_iris' );
?>