-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
executable file
·37 lines (35 loc) · 992 Bytes
/
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
<?php
/**
* Fired when the plugin is uninstalled.
*
* @package WC_Role_Methods
* @author Bryan Purcell <support@wpbackoffice.com>
* @license GPL-2.0+
* @link http://woothemes.com/woocommerce
* @copyright 2014 WPBackOffice
*/
// If uninstall not called from WordPress, then exit
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
if (is_multisite()) {
global $wpdb;
$blogs = $wpdb->get_results("SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A);
delete_option('OPTION_NAME');
if ($blogs) {
foreach($blogs as $blog) {
switch_to_blog($blog['blog_id']);
delete_option('woocommerce_payment_roles');
delete_option('woocommerce_shipping_roles');
delete_option('woocommerce_group_shipping_roles');
delete_option('woocommerce_group_payment_roles');
}
}
}
else
{
delete_option('woocommerce_payment_roles');
delete_option('woocommerce_shipping_roles');
delete_option('woocommerce_group_shipping_roles');
delete_option('woocommerce_group_payment_roles');
}