Exemplo n.º 1
0
 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new maxButtons();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
 function __construct()
 {
     $this->plugin_url = self::get_plugin_url();
     //plugins_url() . '/' . $this->plugin_name;
     $this->plugin_path = self::get_plugin_path();
     //plugin_dir_path($rootfile);
     $this->plugin_name = trim(basename($this->plugin_path), '/');
     $this->installed_version = get_option('MAXBUTTONS_VERSION_KEY');
     maxInstall::check_database();
     // sigh
     add_action('init', array($this, 'load_textdomain'));
     add_action('admin_init', array($this, 'addthick'));
     add_filter('widget_text', 'do_shortcode');
     add_shortcode('maxbutton', array($this, 'shortcode'));
     add_action("mb-footer", array($this, 'do_footer'), 10, 3);
     add_action("wp_footer", array($this, "footer"));
     add_action('media_buttons_context', array($this, 'maxbuttons_media_button'));
     add_filter('plugin_action_links', array($this, "plugin_action_links"), 10, 2);
     add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2);
     add_filter("admin_footer_text", array($this, "admin_footer_text"));
     if (is_admin()) {
         add_action('admin_enqueue_scripts', array($this, 'add_admin_styles'));
         add_action('admin_enqueue_scripts', array($this, 'add_admin_scripts'));
         add_action('admin_init', array($this, 'register_settings'));
         add_action('admin_menu', array($this, 'admin_menu'));
         add_action('admin_footer', array($this, 'media_button_admin_footer'));
         add_action('admin_footer', array($this, "footer"));
         // errors in user space. No internal error but user output friendly issues
         add_action("mb_display_notices", array($this, "display_notices"));
         add_action("wp_ajax_getAjaxButtons", array('maxButtonsAdmin', 'getAjaxButtons'));
     }
     $this->setMainClasses();
     // struct for override functionality
     // The second the blocks are being loaded, check dbase integrity
     add_action("mb_blockclassesloaded", array($this, "check_database"));
     self::$instance = $this;
 }