/** * Constructor * @param null */ function __construct($settings) { $this->settings = $settings; parent::__construct(); //if there is installed another plugin with a never version //do not load this one further if (!$this->canLoad()) { return; } // Shortcodes add_shortcode('shareyourcart', array(&$this, 'getButton')); add_shortcode('shareyourcart_button', array(&$this, 'getButton')); // Actions add_action('init', array(&$this, 'init')); add_action('wp', array(&$this, 'hook_buttons')); add_action('wp_head', array(&$this, 'wp_head')); }
/** * Constructor * @param null */ function __construct() { parent::__construct(); //if there is installed another plugin with a never version //do not load this one further if (!$this->canLoad()) { return; } //make sure we add this instance self::$_INSTANCES[] = $this; $this->_PLUGIN_PATH = WP_PLUGIN_URL . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__)); //setup the hooks register_activation_hook(self::getPluginFile(), array(&$this, 'activateHook')); register_deactivation_hook(self::getPluginFile(), array(&$this, 'deactivateHook')); //perform the rest of the loading AFTER all plugins have been loaded add_action('plugins_loaded', array(&$this, 'pluginsLoadedHook')); }