/** Init eventON when WordPress Initialises. */ public function init() { // Set up localisation $this->load_plugin_textdomain(); $this->template_url = apply_filters('eventon_template_url', 'eventon/'); $this->evo_generator = new EVO_generator(); $this->frontend = new evo_frontend(); // Classes/actions loaded for the frontend and for ajax requests if (!is_admin() || defined('DOING_AJAX')) { // Class instances $this->shortcodes = new EVO_Shortcodes(); } if (is_admin()) { $this->evo_event = new evo_event(); $this->evo_admin = new evo_admin(); } // roles and capabilities eventon_init_caps(); global $pagenow; $__needed_pages = array('update-core.php', 'plugins.php', 'admin.php', 'admin-ajax.php', 'plugin-install.php', 'index.php'); // only for admin Eventon updater if (is_admin() && !empty($pagenow) && in_array($pagenow, $__needed_pages)) { // Initiate eventon updater require_once 'includes/admin/class-evo-updater.php'; $this->evo_updater = new evo_updater(array('version' => $this->version, 'slug' => strtolower(EVENTON_BASE), 'plugin_slug' => AJDE_EVCAL_BASENAME, 'name' => EVENTON_BASE)); } // Init action do_action('eventon_init'); }
/** * Init eventON when WordPress Initialises. */ public function init() { // Set up localisation $this->load_plugin_textdomain(); $this->template_url = apply_filters('eventon_template_url', 'eventon/'); // Classes/actions loaded for the frontend and for ajax requests if (!is_admin() || defined('DOING_AJAX')) { // Class instances $this->evo_generator = new EVO_generator(); $this->shortcodes = new EVO_Shortcodes(); // Hooks add_action('init', array($this, 'register_scripts'), 10); add_action('wp_enqueue_scripts', array($this, 'load_default_evo_styles'), 10); add_action('wp_head', array($this, 'load_dynamic_evo_styles'), 50); add_action('wp_head', array($this, 'generator')); } // roles and capabilities eventon_init_caps(); global $pagenow; $__needed_pages = array('update-core.php', 'plugins.php', 'admin.php', 'admin-ajax.php', 'plugin-install.php', 'index.php'); //print_r($pagenow); // only for admin if (is_admin() && !empty($pagenow) && in_array($pagenow, $__needed_pages)) { // Initiate eventon update checker require_once 'classes/class-evo-updater.php'; $api_url = 'http://update.myeventon.com'; //$api_url = 'http://update.myeventon.com/index-temp.php'; $this->evo_updater = new evo_updater($this->version, $api_url, AJDE_EVCAL_BASENAME); //$GLOBALS['evo_updater'] = new evo_updater( $this->version, $api_url, AJDE_EVCAL_BASENAME); } // Init action do_action('eventon_init'); }