# supportcandy/2.3.1/includes/admin/settings/set_thankyou_settings.php

SupportCandy – AI Customer Support Ticket System &amp; Live Chatbot Agent, version 2.3.1. 27 lines.

- Page: https://pluginprobe.com/plugins/supportcandy/2.3.1/code/includes/admin/settings/set_thankyou_settings.php
- Raw: https://pluginprobe.com/plugins/supportcandy/2.3.1/raw/includes/admin/settings/set_thankyou_settings.php
- Modified: 2022-07-21T08:20:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/supportcandy/2.3.1/code/includes/admin/settings/set_thankyou_settings.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

global $current_user;

if (
	check_ajax_referer('set_thankyou_settings', '_ajax_nonce', false) != 1
) wp_send_json_error('Unauthorised request!', 400);

if (!($current_user->ID && $current_user->has_cap('manage_options'))) {
	exit;
}

// Thank you messege
$wpsc_thankyou_html = isset($_POST) && isset($_POST['wpsc_thankyou_html']) ? wp_kses_post(stripslashes(htmlspecialchars_decode($_POST['wpsc_thankyou_html'], ENT_QUOTES))) : '';
update_option('wpsc_thankyou_html',$wpsc_thankyou_html);

// Thank you URL
$wpsc_thankyou_url = isset($_POST) && isset($_POST['wpsc_thankyou_url']) ? sanitize_text_field($_POST['wpsc_thankyou_url']) : '';
update_option('wpsc_thankyou_url',$wpsc_thankyou_url);

do_action('wpsc_set_gerneral_settings');

echo '{ "sucess_status":"1","messege":"'.__('Settings saved.','supportcandy').'" }';

```
