public static function get_instance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
public function __construct() { // Load text domain load_plugin_textdomain('zendesk', null, basename(dirname(__FILE__)) . '/languages'); add_action('admin_menu', array(Zendesk_Wordpress_Admin::get_instance(), '_admin_menu')); add_action('admin_init', array(Zendesk_Wordpress_Admin::get_instance(), '_admin_init')); // AJAX calls add_action('wp_ajax_zendesk_view_ticket', array(Zendesk_Wordpress_Ajax::get_instance(), '_ajax_view_ticket')); add_action('wp_ajax_zendesk_get_view', array(Zendesk_Wordpress_Ajax::get_instance(), '_ajax_get_view')); add_action('wp_ajax_zendesk_convert_to_ticket', array(Zendesk_Wordpress_Ajax::get_instance(), '_ajax_convert_to_ticket')); add_action('wp_ajax_zendesk_convert_to_ticket_post', array(Zendesk_Wordpress_Ajax::get_instance(), '_ajax_convert_to_ticket_post')); add_action('wp_ajax_zendesk_view_comments', array(Zendesk_Wordpress_Ajax::get_instance(), '_ajax_view_comments')); // Initialize $this->setup(); // Setup the Dashboard widget. add_action('wp_dashboard_setup', array(Zendesk_Wordpress_Dashboard_Widget::get_instance(), '_dashboard_widget_setup')); // Let's see if we need to do a remote auth. $this->_do_remote_auth(); // Let's see if Dropbox is set to auto if (isset($this->settings['dropbox_display']) && $this->settings['dropbox_display'] == 'auto') { add_action('wp_footer', array(&$this, 'dropbox_code')); } // Let's see if the visibility of the Web Widget is set to auto if (isset($this->settings['webwidget_display']) && $this->settings['webwidget_display'] == 'auto') { add_action('wp_footer', array(&$this, 'webwidget_code')); } }