isset($_POST['default_model']) ? sanitize_text_field(wp_unslash((string) $_POST['default_model'])) : '', 'poll_timeout' => isset($_POST['poll_timeout']) ? absint(wp_unslash($_POST['poll_timeout'])) : SettingsStore::DEFAULT_POLL_TIMEOUT, 'poll_interval' => isset($_POST['poll_interval']) ? absint(wp_unslash($_POST['poll_interval'])) : SettingsStore::DEFAULT_POLL_INTERVAL, 'archive_after_run' => isset($_POST['archive_after_run']), ); SettingsStore::update($settings); add_settings_error( 'ai_provider_for_cursor', 'settings_updated', __('Settings saved.', 'ai-provider-for-cursor'), 'success' ); } /** * Renders the settings page. * * @since 0.1.0 */ public static function render(): void { if (!current_user_can('manage_options')) { return; } $settings = SettingsStore::all(); settings_errors('ai_provider_for_cursor'); ?>