/** * This function must be called immediatly after loading the class. * It forces to attach the appropriate handlers to load the .css and .js * files. */ static public function activate($needed = self::ADMINPAGE_ONLY) { $obj = null; isset($this) ? $obj = $this : $obj = new self(); switch($needed) { case self::PAGES_ONLY: case self::ALL_PAGES: self::$show_on_pages = $needed; break; case self::ADMINPAGE_ONLY: default: self::$show_on_pages = self::ADMINPAGE_ONLY; } // currently only this is supported self::$show_on_pages = self::ADMINPAGE_ONLY; add_action('admin_init', array(&$obj, 'handler_wp_admin_init' )); }