Inventory_Presser_Customize_Dashboard::load_scripts( string $hook )

load_scripts


Description Description

Includes JavaScripts and stylesheets that power our changes to the dashboard.


Top ↑

Parameters Parameters

$hook

(string) (Required)


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-customize-admin-dashboard.php

	function load_scripts( $hook )
	{
		wp_enqueue_style( 'my-admin-theme', plugins_url( '/css/wp-admin.min.css', INVP_PLUGIN_FILE_PATH ) );
		wp_register_script( 'invp-js', plugins_url( '/js/admin.min.js', INVP_PLUGIN_FILE_PATH ) );
		wp_enqueue_script( 'invp-js' );

		//Provide data to JavaScript for the editor
		wp_add_inline_script( 'invp-js', 'const invp = ' . json_encode( array(
			'hull_materials'      => apply_filters( 'invp_default_hull_materials', array(
				'Aluminum',
				'Carbon Fiber',
				'Composite',
				'Ferro-Cement',
				'Fiberglass',
				'Hypalon',
				'Other',
				'PVC',
				'Steel',
				'Wood',
			) ),
			'miles_word'          => apply_filters( 'invp_odometer_word', 'miles' ),
			'meta_prefix'         => INVP::meta_prefix(),
			'payment_frequencies' => apply_filters( 'invp_default_payment_frequencies', array(
				'Monthly'      => 'monthly',
				'Weekly'       => 'weekly',
				'Bi-weekly'    => 'biweekly',
				'Semi-monthly' => 'semimonthly',
			) ),
			'delete_all_media_nonce' => wp_create_nonce( self::NONCE_DELETE_ALL_MEDIA ),
		) ), 'before' );
	}