/**
  * Register callbacks for actions and filters
  *
  * @since    1.0.0
  */
 protected function register_hook_callbacks()
 {
     LeafletLayers_Actions_Filters::add_shortcode('leafmap', 'leafmap_html');
     if (self::$model_sett->get_settings('leafletlayers_collab_form')) {
         LeafletLayers_Actions_Filters::add_shortcode('leafmapform', 'leafmap_form');
         LeafletLayers_Actions_Filters::add_action('wp_ajax_marker_submission', $this, 'leafletlayers_public_add');
         LeafletLayers_Actions_Filters::add_action('wp_ajax_nopriv_marker_submission', $this, 'leafletlayers_public_add');
     }
     LeafletLayers_Actions_Filters::add_action('wp_enqueue_scripts', $this, 'enqueue_styles');
     LeafletLayers_Actions_Filters::add_action('wp_footer', $this, 'enqueue_scripts');
 }
 /**
  * Register callbacks for actions and filters
  *
  * @since    1.0.0
  */
 protected function register_hook_callbacks()
 {
     LeafletLayers_Actions_Filters::add_action('admin_menu', $this, 'plugin_menu');
     LeafletLayers_Actions_Filters::add_action('admin_post_leafletlayers_add_marker', $this, 'add_marker');
     LeafletLayers_Actions_Filters::add_action('admin_post_leafletlayers_edit_marker', $this, 'save_edited_marker');
     LeafletLayers_Actions_Filters::add_action('admin_post_leafletlayers_delete_marker', $this, 'delete_marker');
     LeafletLayers_Actions_Filters::add_action('admin_post_leafletlayers_validate_marker', $this, 'validate_marker');
     LeafletLayers_Actions_Filters::add_action('admin_post_leafletlayers_add_group', $this, 'add_group');
     LeafletLayers_Actions_Filters::add_action('admin_post_leafletlayers_edit_group', $this, 'save_edited_group');
     LeafletLayers_Actions_Filters::add_action('admin_post_leafletlayers_delete_group', $this, 'delete_group');
     LeafletLayers_Actions_Filters::add_action('admin_enqueue_scripts', $this, 'enqueue_admin_stuff');
 }
 public static function add_shortcode($tag, $function_name)
 {
     self::$shortcodes = self::add_short(self::$shortcodes, $tag, $function_name);
 }
예제 #4
0
 /**
  * Define the core functionality of the plugin.
  *
  * Load the dependencies, define the locale, and set the hooks for the admin area and
  * the public-facing side of the site.
  *
  * @since    1.0.0
  */
 public function __construct()
 {
     self::$plugin_path = plugin_dir_path(dirname(__FILE__));
     self::$plugin_url = plugin_dir_url(dirname(__FILE__));
     require_once self::$plugin_path . 'includes/class-' . self::PLUGIN_PREFIX . 'loader.php';
     self::$modules['LeafletLayers_Loader'] = LeafletLayers_Loader::get_instance();
     self::$modules['LeafletLayers_Controller_Public'] = LeafletLayers_Controller_Public::get_instance();
     self::$modules['LeafletLayers_Controller_Admin_Settings'] = LeafletLayers_Controller_Admin_Settings::get_instance();
     self::$modules['LeafletLayers_Controller_Admin_Notices'] = LeafletLayers_Controller_Admin_Notices::get_instance();
     self::$modules['LeafletLayers_Controller_Admin_Menu'] = LeafletLayers_Controller_Admin_Menu::get_instance();
     LeafletLayers_Actions_Filters::init_actions_filters();
 }
 /**
  * Register callbacks for actions and filters
  *
  * @since    1.0.0
  */
 protected function register_hook_callbacks()
 {
     LeafletLayers_Actions_Filters::add_action('admin_menu', $this, 'plugin_menu');
     LeafletLayers_Actions_Filters::add_action('load-' . static::$hook_suffix, $this, 'register_fields');
     LeafletLayers_Actions_Filters::add_filter('plugin_action_links_' . LeafletLayers::PLUGIN_ID . '/' . LeafletLayers::PLUGIN_ID . '.php', $this, 'add_plugin_action_links');
 }
 /**
  * Define the locale for this plugin for internationalization.
  *
  * Uses the LeafletLayers_i18n class in order to set the domain and to register the hook
  * with WordPress.
  *
  * @since    1.0.0.0
  */
 private function set_locale()
 {
     $plugin_i18n = new LeafletLayers_i18n();
     $plugin_i18n->set_domain(LeafletLayers::PLUGIN_ID);
     LeafletLayers_Actions_Filters::add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
 }
 /**
  * Register callbacks for actions and filters
  *
  * @since    1.0.0
  */
 protected function register_hook_callbacks()
 {
     LeafletLayers_Actions_Filters::add_action('admin_notices', $this, 'show_admin_notices');
 }
 /**
  * Register callbacks for actions and filters
  *
  * @since    1.0.0
  */
 protected function register_hook_callbacks()
 {
     LeafletLayers_Actions_Filters::add_action('admin_init', $this, 'register_settings');
 }