-
Notifications
You must be signed in to change notification settings - Fork 2
/
uninstall.php
53 lines (43 loc) · 1.81 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
48
49
50
51
52
53
<?php
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit();
}
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
global $wpdb;
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
if ( $blog_ids !== false ) {
foreach ( $blog_ids as $blog_id ) {
switch_to_blog( $blog_id );
bqw_accordion_slider_delete_all_data();
}
restore_current_blog();
}
} else {
bqw_accordion_slider_delete_all_data();
}
function bqw_accordion_slider_delete_all_data() {
global $wpdb;
$prefix = $wpdb->prefix;
$accordions_table = $prefix . 'accordionslider_accordions';
$panels_table = $prefix . 'accordionslider_panels';
$layers_table = $prefix . 'accordionslider_layers';
$wpdb->query( "DROP TABLE $accordions_table, $panels_table, $layers_table" );
delete_option( 'accordion_slider_custom_css' );
delete_option( 'accordion_slider_custom_js' );
delete_option( 'accordion_slider_is_custom_css' );
delete_option( 'accordion_slider_is_custom_js' );
delete_option( 'accordion_slider_load_stylesheets' );
delete_option( 'accordion_slider_load_custom_css_js' );
delete_option( 'accordion_slider_load_unminified_scripts' );
delete_option( 'accordion_slider_cache_expiry_interval' );
delete_option( 'accordion_slider_hide_inline_info' );
delete_option( 'accordion_slider_hide_getting_started_info' );
delete_option( 'accordion_slider_hide_custom_css_js_warning' );
delete_option( 'accordion_slider_hide_image_size_warning' );
delete_option( 'accordion_slider_version' );
delete_transient( 'accordion_slider_post_names' );
delete_transient( 'accordion_slider_posts_data' );
delete_transient( 'accordion_slider_update_notification_message' );
delete_transient( 'accordion_slider_add_ons_cached_data' );
$wpdb->query( "DELETE FROM " . $prefix . "options WHERE option_name LIKE '%accordion_slider_cache_%'" );
}