-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
47 lines (43 loc) · 2.03 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
if (!defined('WP_UNINSTALL_PLUGIN')) {
die;
}
if (!function_exists('wccao_uninstall_conditionally')) {
function wccao_uninstall_conditionally() {
// Check if option 'wccao_coupons_after_order_data_uninstall' is set to 'yes'
$data_uninstall = get_option('wccao_coupons_after_order_data_uninstall');
if ($data_uninstall === 'yes') {
$wccao_options = array(
'wccao_coupons_after_order_enable',
//'wccao_coupons_after_order_event_trigger',
'wccao_coupons_after_order_availability_start_enabled',
'wccao_coupons_after_order_availability_start_date',
'wccao_coupons_after_order_validity_type',
'wccao_coupons_after_order_validitydays',
'wccao_coupons_after_order_validitydate',
'wccao_coupons_after_order_count',
'wccao_coupons_after_order_usage_limit',
'wccao_coupons_after_order_individual_use',
'wccao_coupons_after_order_min_amount',
'wccao_coupons_after_order_email_restriction',
'wccao_coupons_after_order_prefix',
'wccao_coupons_after_order_url_parameter',
'wccao_coupons_after_order_email_subject',
'wccao_coupons_after_order_email_header',
'wccao_coupons_after_order_email_content',
'wccao_coupons_after_order_email_bt_title',
'wccao_coupons_after_order_email_bt_url',
'wccao_coupons_after_order_email_bt_color',
'wccao_coupons_after_order_email_bt_bg_color',
'wccao_coupons_after_order_email_bt_font_size',
'wccao_coupons_after_order_coupon_font_color',
'wccao_coupons_after_order_coupon_bg_color',
'wccao_coupons_after_order_data_uninstall',
);
foreach ($wccao_options as $wcao_option) {
delete_option($wcao_option);
}
}
}
}
wccao_uninstall_conditionally();