public function getAllOptions() { if (empty(self::$allOptions)) { self::$allOptions = array(); } if (empty(self::$allOptions[$this->optionNamespace])) { self::$allOptions[$this->optionNamespace] = array(); } else { return self::$allOptions[$this->optionNamespace]; } // Check if we have options saved already $currentOptions = get_option($this->optionNamespace . '_options'); // Put all the available options in our global variable for future checking if (!empty($currentOptions) && !count(self::$allOptions[$this->optionNamespace])) { self::$allOptions[$this->optionNamespace] = unserialize($currentOptions); } return self::$allOptions[$this->optionNamespace]; }