Example #1
0
 function __construct()
 {
     self::$options = Mappress_Options::get();
     self::$basename = plugin_basename(__FILE__);
     self::$baseurl = plugins_url('', __FILE__);
     self::$basedir = dirname(__FILE__);
     $this->debugging();
     // Initialize Pro classes
     if (class_exists('Mappress_Pro')) {
         self::$geocoders = new Mappress_Geocoders();
         self::$updater = new Mappress_Updater(self::$basename);
     }
     add_action('admin_menu', array($this, 'admin_menu'));
     add_action('init', array($this, 'init'));
     add_shortcode('mappress', array($this, 'shortcode_map'));
     add_action('admin_notices', array($this, 'admin_notices'));
     // Post hooks
     add_action('deleted_post', array($this, 'deleted_post'));
     // Filter to automatically add maps to post/page content
     add_filter('the_content', array($this, 'the_content'), 2);
     // Scripts and stylesheets
     add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'));
     add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     // Frontend: output map in footer or header
     if (self::$options->footer) {
         add_action('wp_print_footer_scripts', array($this, 'print_maps'));
     }
     // Admin: output in footer only
     add_action('admin_print_footer_scripts', array($this, 'print_maps'));
     // Slow heartbeat
     if (self::$debug) {
         add_filter('heartbeat_settings', array($this, 'heartbeat_settings'));
     }
 }
Example #2
0
 function __construct()
 {
     self::$options = Mappress_Options::get();
     self::$basename = plugin_basename(__FILE__);
     self::$baseurl = plugins_url('', __FILE__);
     self::$basedir = dirname(__FILE__);
     $this->debugging();
     if (self::$remote) {
         self::$js = 'http://localhost/dev/wp-content/plugins/mappress-google-maps-for-wordpress/src';
     } elseif (defined('MAPPRESS_DEBUG')) {
         self::$js = self::$baseurl . '/src';
     } else {
         self::$js = self::$baseurl . '/js';
     }
     // Initialize Pro classes
     if (class_exists('Mappress_Pro')) {
         $icons = new Mappress_Icons();
         self::$geocoders = new Mappress_Geocoders();
         self::$updater = new Mappress_Updater(self::$basename);
     }
     add_action('admin_menu', array(&$this, 'admin_menu'));
     add_action('init', array(&$this, 'init'));
     add_shortcode('mappress', array(&$this, 'shortcode_map'));
     add_action('admin_notices', array(&$this, 'admin_notices'));
     // Post hooks
     add_action('deleted_post', array(&$this, 'deleted_post'));
     // Filter to automatically add maps to post/page content
     add_filter('the_content', array(&$this, 'the_content'), 2);
     // Scripts and stylesheets
     add_action('wp_enqueue_scripts', array(&$this, 'wp_enqueue_scripts'));
     add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
     // Output map data in footer
     add_action('wp_print_footer_scripts', array(&$this, 'print_maps'));
     add_action('admin_print_footer_scripts', array(&$this, 'print_maps'));
 }