Documentation | Support';
$global_fieldset_names["FOOTER_NOTICES"] = $notices;
require_once (CGMP_PLUGIN_DIR . '/functions.php');
require_once (CGMP_PLUGIN_DIR . '/widget.php');
require_once (CGMP_PLUGIN_DIR . '/shortcode.php');
require_once (CGMP_PLUGIN_DIR . '/metabox.php');
require_once (CGMP_PLUGIN_DIR . '/menu.php');
require_once (CGMP_PLUGIN_DIR . '/head.php');
add_action('init', 'cgmp_google_map_init_scripts');
add_action('admin_init', 'cgmp_google_map_admin_add_style');
add_action('admin_init', 'cgmp_google_map_admin_add_script');
add_action('admin_menu', 'cgmp_google_map_meta_boxes');
add_action('admin_menu', 'cgmp_google_map_plugin_menu');
add_action('widgets_init', create_function('', 'return register_widget("ComprehensiveGoogleMap_Widget");'));
add_shortcode('google-map-v3', 'cgmp_shortcode_googlemap_handler');
add_action('wp_head', 'cgmp_google_map_deregister_scripts', 200);
add_action('wp_head', 'cgmp_google_map_add_google_api', 500);
function cgmp_google_map_deregister_scripts() {
$handle = '';
global $wp_scripts;
foreach ( $wp_scripts->registered as $script) {
if (strpos($script->src, 'http://maps.googleapis.com/maps/api/js') !== false && $script->handle != 'cgmp-google-map-api') {
if (!isset($script->handle) || $script->handle == '') {
$script->handle = 'remove-google-map-duplicate';
}
unset($script->src);
$handle = $script->handle;
}
if ($handle != '') {
$wp_scripts->remove( $handle );
$handle = '';
}
}
}
function cgmp_google_map_add_google_api() {
wp_enqueue_script('cgmp-google-map-api', CGMP_GOOGLE_API_URL, array('jquery'), true);
}
?>