PluginProbe
Image Hotspot – Map Image Annotation / 1.2
Image Hotspot – Map Image Annotation v1.2
3.8 3.7 3.6 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 All 30 releases
image-map-hotspots / index.php

index.php in Image Hotspot – Map Image Annotation 1.2, at index.php

78 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Image Hotspot - Map Image Annotation
4 Plugin URI: https://wordpress.org/plugins/image-map-hotspots/
5 Description: Image hotspot lets you easily add custom tooltips to your images and add hotspot when highlighting them. Furthermore, you have the option of setting customized tooltip content, position, animation, and more.
6 Author: Sk Abul Hasan
7 Author URI: https://www.wpmart.org/
8 Version: 1.2
9 */
10
11 if (!defined('ABSPATH'))
12 exit;
13
14 define('imh_6310_plugin_url', plugin_dir_path(__FILE__));
15 define('imh_6310_plugin_dir_url', plugin_dir_url(__FILE__));
16 define ( 'imh_6310_PLUGIN_CURRENT_VERSION', 1.2 );
17
18 add_shortcode('imh_6310_image_map', 'imh_6310_image_map_shortcode');
19
20 function imh_6310_image_map_shortcode($atts)
21 {
22 extract(shortcode_atts(array('id' => ' ',), $atts));
23 $ids = (int) $atts['id'];
24
25 ob_start();
26 include(imh_6310_plugin_url . 'shortcode.php');
27 return ob_get_clean();
28 }
29
30
31 add_action('admin_menu', 'imh_6310_image_map_menu');
32
33 function imh_6310_image_map_menu()
34 {
35 $options = imh_6310_get_user_roles();
36 add_menu_page('Image Map Hotspot', 'Image Map Hotspot', $options, 'imh-6310-image-map-hotspot', 'imh_6310_home', 'dashicons-format-image', 20);
37 add_submenu_page('imh-6310-image-map-hotspot', 'Image Map Hotspot', 'All Image Map Hotspot', $options, 'imh-6310-image-map-hotspot', 'imh_6310_home');
38 add_submenu_page('imh-6310-image-map-hotspot', 'Settings', 'Settings', $options, 'imh-6310-image-map-hotspot-setting', 'imh_6310_image_map_hotspot_setting');
39 // add_submenu_page('imh-6310-image-map-hotspot', 'Import / Export Plugin', 'Import/Export Plugin', $options, 'imh-6310-image-map-hotspot-import-export', 'imh_6310_image_map_hotspot_import_export');
40 add_submenu_page('imh-6310-image-map-hotspot', 'License', 'License', $options, 'imh-6310-image-map-hotspot-license', 'imh_6310_image_map_hotspot_lincense');
41 add_submenu_page('imh-6310-image-map-hotspot', 'How to use', 'Help', $options, 'imh-6310-image-map-hotspot-use', 'imh_6310_image_map_hotspot_how_to_use');
42 add_submenu_page('imh-6310-image-map-hotspot', 'WpMart Plugins', 'WpMart Plugins', $options, 'imh-6310-wpmart-plugins', 'imh_6310_wpmart_plugins');
43 }
44
45 include imh_6310_plugin_url . 'template-menu.php';
46
47 function imh_6310_my_enqueue()
48 {
49 wp_localize_script('ajax-script', 'my_ajax_object', array('ajax_url' => admin_url('admin-ajax.php')));
50 }
51
52 add_action('wp_enqueue_scripts', 'imh_6310_my_enqueue');
53
54 register_activation_hook(__FILE__, 'imh_6310_image_map_install');
55 include_once(imh_6310_plugin_url . 'functions.php');
56
57 function imh_6310_ajax_enqueue()
58 {
59 wp_localize_script('imh-6310-ajax-script', 'imh_6310_ajax_object', array('imh_6310_ajax_url' => admin_url('admin-ajax.php')));
60 }
61
62 add_action('wp_enqueue_scripts', 'imh_6310_ajax_enqueue');
63
64 function imh_6310_activation_redirect( $plugin ) {
65 if( $plugin == plugin_basename( __FILE__ ) ) {
66 exit( wp_redirect( admin_url( 'admin.php?page=imh-6310-image-map-hotspot-use' ) ) );
67 }
68 }
69 add_action( 'activated_plugin', 'imh_6310_activation_redirect' );
70
71 add_action( 'admin_enqueue_scripts', 'imh_6310_link_css_js' );
72
73
74 function imh_6310_plugin_update_check() {
75 imh_6310_version_status();
76 imh_6310_check_field_exists();
77 }
78 add_action('plugins_loaded', 'imh_6310_plugin_update_check');