"0.0", "Affiliate_ID" => "1" )); if (get_option("skel_abundatrade_options", false) === false) { $options = array(); } else { $options = get_option("skel_abundatrade_options"); } $options = array_merge($default, $options); return $options; } public function applySettings($var) { foreach($var as $setting => $value) { if (isset($this->$setting)) $this->$setting = $value; } } /** * Reduces the class's settings to an array and returns them * @var mixed $settings Other settings to merge these with (for addons) * @return mixed The settings array */ function getSettings($settings) { $this->reduceSettings(); return array_merge($settings, $this->settings_array); } /** * Run update code here * @var string $version The version that was installed previously * @var string $coded_version The version that is currently running (or to update to) */ function update($version, $coded_version) { //do update stuff here } /** * Gets the plugin settings * @return skel__settings This plugin's settings class */ public static function Settings() { $settings = apply_filters("abundatrade(settings)", array()); return $settings[0]; } public static function RenderBox($title, $description = '', $inputs = null) { ?>

">

" . $input['name'] . ": "; echo " $value) { echo $part . "=\"" . $value . "\""; } echo " />

"; } } ?>
settings_array = apply_filters("abundatrade(default_options)", array()); foreach ($this->settings_array as $setting => $setto) { $this->$setting = $setto; } if ($this->version != $this->coded_version) { do_action("abundatrade(update)", $this->version, $this->coded_version); $this->version = $this->coded_version; } add_action("shutdown", array($this, "save")); } /** * Reduces all class vars into an array for saving or distribution */ private function reduceSettings() { foreach ($this->settings_array as $setting => $setto) { $this->settings_array[$setting] = $this->$setting; } } /** * Reduces class vars and then saves them to the db */ function save() { $this->reduceSettings(); update_option("skel_abundatrade_options", $this->settings_array); } }