PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 2.3.1
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v2.3.1
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / includes / admin / email_notifications / delete_ticket_notification.php

delete_ticket_notification.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 2.3.1, at includes/admin/email_notifications/delete_ticket_notification.php

37 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 global $current_user, $wpscfunction;
7
8 if (
9 check_ajax_referer('delete_ticket_notification', '_ajax_nonce', false) != 1
10 ) wp_send_json_error('Unauthorised request!', 400);
11
12 if (!($current_user->ID && $current_user->has_cap('manage_options'))) {
13 exit;
14 }
15
16 $term_id = isset($_POST) && isset($_POST['term_id']) ? intval($_POST['term_id']) : 0;
17 if(!$term_id) die();
18
19 $email_subject = get_option('wpsc_email_notification_subject');
20 unset($email_subject['email_subject_' . $term_id]);
21 update_option('wpsc_email_notification_subject', $email_subject);
22
23 $email_body = get_option('wpsc_email_notification_body');
24 unset($email_body['email_body_' . $term_id]);
25 update_option('wpsc_email_notification_body', $email_body);
26
27 $response = wp_delete_term( $term_id,'wpsc_en');
28
29 if(!is_wp_error($response)){
30
31 do_action('wpsc_delete_ticket_notification',$term_id);
32 echo '{ "sucess_status":"1","messege":"'.__('Email Notification delete successfull.','supportcandy').'" }';
33
34 } else {
35 echo '{ "sucess_status":"0","messege":"'.__('An error occured while deleting email notification.','supportcandy').'" }';
36 }
37