/** * Ensure the group setting keys are not lost when the settings are saved. Clear the cached settings if no feeds exist so the new format keys will be used. * * @return array The post data containing the updated settings. */ public function get_posted_settings() { $post_data = parent::get_posted_settings(); if ($this->is_plugin_settings($this->_slug) && $this->is_save_postback() && !empty($post_data)) { $feed_count = $this->count_feeds(); if ($feed_count > 0) { $settings = $this->get_previous_settings(); $settings['apiKey'] = rgar($post_data, 'apiKey'); return $settings; } else { GFCache::delete('mailchimp_plugin_settings'); } } return $post_data; }
/** * Retrieves the settings from the $_POST and reformat the couponAmount and couponCode before they are saved. * * @return array The post data containing the updated coupon feed settings. */ public function get_posted_settings() { $post_data = parent::get_posted_settings(); if (!empty($post_data)) { if (isset($post_data['couponAmount'])) { $post_data['couponAmount'] = GFCommon::to_number($post_data['couponAmount']); } if (isset($post_data['couponCode'])) { $post_data['couponCode'] = strtoupper($post_data['couponCode']); } } return $post_data; }