-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
uninstaller.php
53 lines (47 loc) · 1.28 KB
/
uninstaller.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
48
49
50
51
52
53
<?php
$vkExUnit_options = vkExUnit_get_common_options();
if ( ! $vkExUnit_options['delete_options_at_deactivate'] ) { return; }
$delete_options = array(
'vkExUnit_common_options',
'vkExUnit_cta_settings',
'vkExUnit_css_customize',
'vkExUnit_ga_options',
'vkExUnit_sitemap_options',
'vkExUnit_sns_options',
'vkExUnit_contact',
'vkExUnit_icon_settings',
'vkExUnit_Ads',
'vkExUnit_description_options',
'vkExUnit_common_keywords',
);
$delete_customfields = array(
'vkexunit_cta_each_option',
'vkExUnit_cta_img',
'vkExUnit_cta_img_position',
'vkExUnit_cta_button_text',
'vkExUnit_cta_url',
'vkExUnit_cta_text',
'vkExUnit_childPageIndex',
'vkExUnit_sitemap',
'vkExUnit_EyeCatch_disable',
'vkExUnit_contact_enable',
'vkExUnit_metaKeyword',
);
$delete_options = apply_filters( 'vkExUnit_uninstall_option', $delete_options );
foreach ( $delete_options as $delete_option_name ) {
delete_option( $delete_option_name );
}
$delete_customfields = apply_filters( 'vkExUnit_uninstall_postmeta', $delete_customfields );
global $wpdb;
foreach ( $delete_customfields as $delete_customfield ) {
$wpdb->delete(
$wpdb->prefix . 'postmeta',
array( 'meta_key' => $delete_customfield ),
array( '%s' )
);
}
$wpdb->delete(
$wpdb->prefix . 'posts',
array( 'post_type' => 'cta' ),
array( '%s' )
);