wpdb = $wpdb; } protected function getDefault() { return json_encode((object)array( 'smoothScroll' => true, 'scrollOnGroupSelection' => true )); } public function load() { $rule0 = get_option(self::KEY, $this->getDefault()); $rule = json_decode($rule0, false); // migration if (! property_exists($rule, 'scrollOnGroupSelection')) { $rule->scrollOnGroupSelection = true; } return $rule; } public function save($rule) { update_option(self::KEY, json_encode($rule)); } }