-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathuninstall.php
More file actions
37 lines (33 loc) · 758 Bytes
/
Copy pathuninstall.php
File metadata and controls
37 lines (33 loc) · 758 Bytes
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
/**
* Uninstaller: removes everything the plugin stored.
*
* @package WP-PageNavi
*/
defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
/**
* Delete the plugin's options for the current site.
*
* @return void
*/
function wp_pagenavi_uninstall_site() {
delete_option( 'pagenavi_options' );
}
if ( is_multisite() ) {
// 'number' => 0 is required: WP_Site_Query defaults to 100, so without it a
// network larger than that would leave the options behind on every site past
// the hundredth.
$site_ids = get_sites(
array(
'fields' => 'ids',
'number' => 0,
)
);
foreach ( $site_ids as $site_id ) {
switch_to_blog( (int) $site_id );
wp_pagenavi_uninstall_site();
restore_current_blog();
}
} else {
wp_pagenavi_uninstall_site();
}