Tribe__Events__Pro__Main::enqueue_pro_scripts( bool $force = false, bool $footer = false )

Enqueue the proper PRO scripts as necessary.


Parameters

$force

(bool) (Optional)

Default value: false

$footer

(bool) (Optional)

Default value: false


Top ↑

Return

(void)


Top ↑

Source

File: src/Tribe/Main.php

		public function enqueue_pro_scripts( $force = false, $footer = false ) {
			global $post;

			if (
				$force
				|| tribe_is_event_query()
				|| ( $post instanceof WP_Post && has_shortcode( $post->post_content, 'tribe_events' ) )
			) {

				// Be sure we enqueue TEC scripts
				tribe_asset_enqueue( 'tribe-events-calendar-script' );
				$data_tec = tribe( 'tec.assets' )->get_js_calendar_script_data();
				wp_localize_script( 'tribe-events-calendar-script', 'tribe_js_config', $data_tec );

				// Be sure we enqueue PRO when needed with the proper localization
				tribe_asset_enqueue( 'tribe-events-pro' );
				$data_pro = tribe( 'events-pro.assets' )->get_data_tribe_events_pro();
				wp_localize_script( 'tribe-events-pro', 'TribeEventsPro', $data_pro );

				if ( ! tribe_is_using_basic_gmaps_api() ) {
					// Be sure we enqueue PRO geoloc when needed with the proper localization
					tribe_asset_enqueue( 'tribe-events-pro-geoloc' );
					$data_geo = tribe( 'events-pro.assets' )->get_data_tribe_geoloc();
					wp_localize_script( 'tribe-events-pro-geoloc', 'GeoLoc', $data_geo );
				}
			}
		}