Inventory_Presser_Taxonomies::load_scripts( string $hook )

load_scripts


Description Description

Loads stylesheets and JavaScript files on pages that edit terms.


Top ↑

Parameters Parameters

$hook

(string) (Required) The file name of the current page


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-taxonomies.php

	function load_scripts( $hook )
	{
		global $current_screen;
		if ( ( $hook == 'edit-tags.php' || $hook == 'term.php')
			&& $current_screen->post_type == INVP::POST_TYPE
			&& $current_screen->taxonomy == 'location' )
		{
			wp_enqueue_style('inventory-presser-timepicker-css',  plugins_url( '/css/jquery.timepicker.min.css', INVP_PLUGIN_FILE_PATH ) );
			wp_enqueue_script('inventory-presser-timepicker', plugins_url( '/js/jquery.timepicker.min.js', INVP_PLUGIN_FILE_PATH ), array('jquery'), '1.8.10');
			wp_enqueue_script('jquery-ui-sortable');
			wp_enqueue_script('inventory-presser-location', plugins_url( '/js/tax-location.min.js', INVP_PLUGIN_FILE_PATH ), array('inventory-presser-timepicker','jquery-ui-sortable'));
		}

	}