Exemplo n.º 1
0
 public function __construct(ICWP_Wordpress_Twitter_Bootstrap_Plugin $oPluginVo)
 {
     // All core values of the plugin are derived from the values stored in this value object.
     $this->oPluginVo = $oPluginVo;
     $this->sPluginRootFile = $this->oPluginVo->getRootFile();
     $this->sPluginSlug = $this->oPluginVo->getPluginSlug();
     self::$sOptionPrefix = $this->oPluginVo->getOptionStoragePrefix();
     $this->setPaths();
     add_action('plugins_loaded', array($this, 'onWpPluginsLoaded'));
     add_action('init', array($this, 'onWpInit'), 0);
     if ($this->isValidAdminArea()) {
         add_action('admin_init', array($this, 'onWpAdminInit'));
         add_action('admin_notices', array($this, 'onWpAdminNotices'));
         add_action('network_admin_notices', array($this, 'onWpAdminNotices'));
         add_action('admin_menu', array($this, 'onWpAdminMenu'));
         add_action('network_admin_menu', array($this, 'onWpAdminMenu'));
         add_action('plugin_action_links', array($this, 'onWpPluginActionLinks'), 10, 4);
         add_action('wp_before_admin_bar_render', array($this, 'onWpAdminBar'), 1, 9999);
     }
     add_action('in_plugin_update_message-' . $this->getPluginBaseFile(), array($this, 'onWpPluginUpdateMessage'));
     add_action('shutdown', array($this, 'onWpShutdown'));
     add_action($this->doPluginPrefix('plugin_shutdown'), array($this, 'doPluginShutdown'));
     $this->registerActivationHooks();
 }
 /**
  * with trailing slash by default
  * @param string $sSubPath
  * @return string
  */
 public function getPluginRootUrl($sSubPath = '')
 {
     return plugins_url($sSubPath, $this->oPluginVo->getRootFile());
 }