-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
65 lines (58 loc) · 1.39 KB
/
uninstall.php
File metadata and controls
65 lines (58 loc) · 1.39 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* CC Smart TOC Uninstall
*
* @package CC_Smart_TOC
*/
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
/**
* Delete data only if user explicitly opted in.
*
* Option name: cc_toc_delete_data_on_uninstall
* Value: '1' or 1
*/
$ccstoc_delete_data = get_option('ccstoc_delete_data_on_uninstall',1);
if ((string) $delete_data !== '1') {
return;
}
/**
* Plugin options detected from plugin settings.
*/
$ccstoc_option_keys = [
'cc_toc_delete_data_on_uninstall',
// Settings (cc_toc_settings group)
'cc_toc_positions',
'cc_toc_post_types',
'cc_toc_numbering',
'cc_toc_auto_insert_mode',
'cc_toc_scrollspy_offset',
'cc_toc_scrollspy_offset_side',
'cc_toc_side_position',
'cc_toc_close_on_click_desktop',
'cc_toc_handle_align',
'cc_toc_min_headings',
'cc_toc_title_label',
'cc_toc_default_state',
'cc_toc_numbering_style',
'cc_toc_max_level',
'cc_toc_custom_css',
'cc_toc_exclude_terms',
'cc_toc_exclude_posts',
'cc_toc_custom_mode',
'cc_toc_custom_h2',
'cc_toc_custom_h3',
'cc_toc_custom_h4',
'cc_toc_custom_h5',
'cc_toc_frame_style',
'cc_toc_theme_color',
'cc_toc_custom_apply',
'cc_toc_custom_colors',
'cc_toc_custom_frame_style',
'cc_toc_fix_threshold',
];
foreach ($ccstoc_option_keys as $ccstoc_key) {
delete_option($ccstoc_key);
delete_site_option($key);
}