-
Notifications
You must be signed in to change notification settings - Fork 16
/
snazzy-maps.php
38 lines (34 loc) · 942 Bytes
/
snazzy-maps.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Manage integration with Snazzy Maps.
* @since 1.10.0
*/
class GeoMashupSnazzyMaps {
/**
* Load Snazzy Maps integrations.
*
* @since 1.10.0
*/
public static function load() {
add_action( 'geo_mashup_render_map', array( __CLASS__, 'enqueue_snazzy_script' ) );
}
/**
* Enqueue the Snazzy Maps script in the Geo Mashup frame.
*
* @since 1.10.0
*/
public static function enqueue_snazzy_script() {
/** @noinspection ClassConstantCanBeUsedInspection */
if ( class_exists( '\SnazzyMaps\SnazzyMaps_Main' ) ) {
// Enqueue function as of 1.1.5
\SnazzyMaps\SnazzyMaps_Main::snazzy_enqueue_script();
} else if ( function_exists( 'snazzy_enqueue_script' ) ) {
// Enqueue function as of 1.1.3
snazzy_enqueue_script();
} else if ( function_exists( 'enqueue_script' ) ) {
// Enqueue function prior to 1.1.3
enqueue_script();
}
GeoMashupRenderMap::enqueue_script( 'snazzymaps-js' );
}
}