/** * Set up the framework * * In addition to the core functionality, set up special functions for the plugin walkthrough, * Style Generator, Control Panel, thumbnails, sidebars, Easy Integration */ function __construct() { $this->editionURL = plugins_url() . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__)); parent::__construct(); //ADMIN if (is_admin()) { //Save Style Generator add_action('sparkoptions_update_settings_' . UBERMENU_SETTINGS, array($this, 'saveStyleGenerator'), 10, 1); //Create the welcome tour $this->createTour(); //Add "Settings" and "Support Guide" links to the Plugins page add_filter('plugin_action_links', array($this, 'pluginActionLinks'), 10, 2); //AJAX clear of show thanks box add_action('wp_ajax_ubermenu_showThanksCleared', array($this, 'showThanksCleared_callback')); //UberMenu Thank You panel add_action('sparkoptions_before_settings_panel_' . UBERMENU_SETTINGS, array($this, 'showThanks')); } //Add Thumbnail Support add_action('after_setup_theme', array($this, 'addThumbnailSupport'), 500); //go near the end, so we don't get overridden //Add Sidebars add_action('init', array($this, 'registerSidebars'), 500); //Note that on the admin side, this runs before settings are updated //UberMenu Easy Integration add_shortcode('uberMenu_easyIntegrate', array('UberMenuStandard', 'easyIntegrate')); if ($this->settings->op('wpmega-easyintegrate')) { add_action('init', array($this, 'registerThemeLocation')); } }
function __construct() { //Determine Base URL - replace slashes for Windows compatibility if (!defined('UBERMENU_LITE_PATH')) { $um_path = str_replace("\\", '/', dirname(dirname(__FILE__))); $um_path = str_replace(str_replace("\\", '/', get_template_directory()), "", $um_path); } else { $um_path = UBERMENU_LITE_PATH; } $um_url = get_template_directory_uri() . $um_path . '/'; $this->editionURL = $um_url . 'lite/'; parent::__construct($um_url); if (!is_admin()) { //Attach this to the after_setup_theme action, as the plugins_loaded hook has already run prior to this being loaded add_action('after_setup_theme', array($this, 'init')); } }