public static function launch($options) { self::$options = $options; add_action('admin_menu', array(__CLASS__, 'create_admin_menu'), 20); add_action('admin_init', array(__CLASS__, 'register_settings')); add_action('admin_enqueue_scripts', array(__CLASS__, 'admin_assets')); add_action('wp_ajax_start_import', array(__CLASS__, 'import_callback')); add_action('wp_ajax_cancel_import', array(__CLASS__, 'cancel_import_callback')); }
protected function __construct() { $this->options = SpotIM_Options::get_instance(); if (is_admin()) { // Launch Admin Page SpotIM_Admin::launch($this->options); } else { // Launch frontend code: embed script, comments template, comments count. SpotIM_Frontend::launch($this->options); } }