public function onWpAdminInit() { parent::onWpAdminInit(); // If it's a plugin admin page, we do certain things we don't do anywhere else. if ($this->getIsPage_PluginAdmin()) { //JS color picker for the Bootstrap LESS if ($_GET['page'] == $this->getSubmenuId('bootstrap-less')) { wp_register_style('miniColors', $this->m_sPluginUrl . 'inc/miniColors/jquery.miniColors.css', false, $this->m_sVersion); wp_enqueue_style('miniColors'); wp_register_script('miniColors', $this->m_sPluginUrl . 'inc/miniColors/jquery.miniColors.min.js', false, $this->m_sVersion, true); wp_enqueue_script('miniColors'); } } }
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(); }