Tribe_Meta_Box::register_scripts_and_styles()


Source

File: lib/tribe-meta-box.php

	public function register_scripts_and_styles() {
		// change '\' to '/' in case using Windows
		$content_dir = str_replace( '\\', '/', WP_CONTENT_DIR );
		$script_dir = str_replace( '\\', '/', dirname( __FILE__ ) );

		// get URL of the directory of current file, this works in both theme or plugin
		$base_url = trailingslashit( str_replace( $content_dir, WP_CONTENT_URL, $script_dir ) );
		$resources_url = apply_filters( 'tribe_apm_resources_url', $base_url . 'resources' );
		$resources_url = trailingslashit( $resources_url );

		wp_register_style( 'tribe-meta-box', $resources_url . 'meta-box.css' );
		wp_register_script( 'tribe-meta-box', $resources_url . 'meta-box.js', array( 'jquery' ), null, true );

		wp_register_style( 'tribe-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . self::get_jqueryui_ver() . '/themes/base/jquery-ui.css' );
		wp_register_script( 'tribe-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . self::get_jqueryui_ver() . '/jquery-ui.min.js', array( 'jquery' ) );
		wp_register_script( 'tribe-timepicker', 'https://github.com/trentrichardson/jQuery-Timepicker-Addon/raw/master/jquery-ui-timepicker-addon.js', array( 'tribe-jquery-ui' ) );
	}