/** * Saves the options for the plugin * * @param array $options formatted the same as from getOptions() * @return void */ public function setOptions($options, $apply_filters = true) { if (!is_array($options)) { return; } if ($apply_filters == true) { $options = apply_filters('tribe-events-save-options', $options); } if (update_option(TribeEvents::OPTIONNAME, $options)) { self::$options = apply_filters('tribe_get_options', $options); if (isset(TribeEvents::$options['eventsSlug'])) { if (TribeEvents::$options['eventsSlug'] != '') { TribeEvents::flushRewriteRules(); } } return true; } else { TribeEvents::$options = TribeEvents::getOptions(); return false; } }
/** * Saves the options for the plugin * * @param array $options formatted the same as from getOptions() * @param bool $apply_filters * * @return void */ public function setOptions($options, $apply_filters = true) { if (!is_array($options)) { return; } if ($apply_filters == true) { $options = apply_filters('tribe-events-save-options', $options); } // @TODO use TribeEvents::getOptions if (update_option(TribeEvents::OPTIONNAME, $options)) { self::$options = apply_filters('tribe_get_options', $options); return true; } else { TribeEvents::$options = TribeEvents::getOptions(); return false; } }