Tribe__Events__Pro__Main::admin_enqueue_scripts()

Enqueues the necessary JS for the admin side of things.

Contents


Return

(void)


Top ↑

Source

File: src/Tribe/Main.php

		public function admin_enqueue_scripts() {

			wp_enqueue_script(
				Tribe__Events__Main::POSTTYPE . '-premium-admin',
				tribe_events_pro_resource_url( 'events-admin.js' ),
				[ 'jquery-ui-datepicker' ],
				apply_filters( 'tribe_events_pro_js_version', self::VERSION ),
				true
			);

			wp_enqueue_script(
				Tribe__Events__Main::POSTTYPE . '-premium-recurrence',
				tribe_events_pro_resource_url( 'events-recurrence.js' ),
				[ Tribe__Events__Main::POSTTYPE.'-premium-admin', 'tribe-events-pro-handlebars', 'tribe-events-pro-moment', 'tribe-dropdowns', 'jquery-ui-dialog', 'tribe-buttonset' ],
				apply_filters( 'tribe_events_pro_js_version', self::VERSION ),
				true
			);

			$data = apply_filters( 'tribe_events_pro_localize_script', [], 'TribeEventsProAdmin', Tribe__Events__Main::POSTTYPE.'-premium-admin' );

			wp_localize_script( Tribe__Events__Main::POSTTYPE . '-premium-admin', 'TribeEventsProAdmin', $data );
			wp_localize_script( Tribe__Events__Main::POSTTYPE . '-premium-admin', 'tribe_events_pro_recurrence_strings', [
				'date'       => Tribe__Events__Pro__Recurrence__Meta::date_strings(),
				'recurrence' => Tribe__Events__Pro__Recurrence__Strings::recurrence_strings(),
				'exclusion'  => [],
			] );
		}