-
Notifications
You must be signed in to change notification settings - Fork 1
/
uninstall.php
130 lines (94 loc) · 2.62 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
/**
* @package WordPress Plugin
* @subpackage Hide Admin Bar and Toolbar
* @description Uninstall Module
* @author sLaNGjIs @ slangji.wordpress.com
* @status Code in Becoming!
* @todolist Full Multisite and BuddyPress Compatibility Support
*
* @indentation www.gnu.org/prep/standards/standards.html
* @license www.gnu.org/licenses/gpl-2.0.html
* @plugin wordpress.org/plugins/global-admin-bar-hide-or-remove
*
* @since WordPress 3.1+
* @tested WordPress 3.7+
* @compatible WordPress 4.4+
* @development WordPress 4.5-alpha
*
* @branche 2014
* @version 1.6.1.2
* @build 2016-01-18 3RD MOD - 2015-08-31 2ND MOD - 2014-04-16 1ST MOD - 2014-04-14
*/
if ( !function_exists( 'add_action' ) )
{
header( 'HTTP/0.9 403 Forbidden' );
header( 'HTTP/1.0 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
header( 'Status: 403 Forbidden' );
header( 'Connection: Close' );
exit;
}
defined ( 'ABSPATH' ) OR exit;
defined ( 'WPINC' ) OR exit;
defined ( 'WP_UNINSTALL_PLUGIN' ) OR exit;
$option_names = array(
/**
* remove all new options from database to keep it clean
*
* sLa NGjI's 2014-05-19
*/
'global-admin-bar-admins',
'global-admin-bar-authors',
'global-admin-bar-bottombackend',
'global-admin-bar-bottomfrontend',
'global-admin-bar-contributors',
'global-admin-bar-cleanup',
'global-admin-bar-default',
'global-admin-bar-disable',
'global-admin-bar-editors',
'global-admin-bar-optimize',
'global-admin-bar-loggedout',
'global-admin-bar-logout',
'global-admin-bar-remove',
'global-admin-bar-roles',
'global-admin-bar-settings',
'global-admin-bar-speedup',
'global-admin-bar-subscribers',
'global-admin-bar-users',
/**
* remove all old options from database to keep it clean
*
* sLa NGjI's 2014-05-18
*/
'global-admin-bar-plugin-setting',
'global-admin-bar-plugin-user-setting',
'global-admin-bar-profiles'
);
if ( ! is_multisite() )
{
foreach ( $option_names as $option_name )
{
delete_option( $option_name );
}
}
if ( is_multisite() )
{
foreach ( $option_names as $option_name )
{
delete_option( $option_name );
}
global $wpdb;
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
$original_blog_id = get_current_blog_id();
foreach ( $blog_ids as $blog_id )
{
switch_to_blog( $blog_id );
foreach ( $option_names as $option_name )
{
delete_site_option( $option_name );
}
}
switch_to_blog( $original_blog_id );
}
?>