This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathuninstall.php
80 lines (67 loc) · 2.18 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
<?php
/**
* WP-Members Uninstall
*
* Removes all settings WP-Members added to the WP options table
*
* This file is part of the WP-Members plugin by Chad Butler
* You can find out more about this plugin at http://rocketgeek.com
* Copyright (c) 2006-2015 Chad Butler
* WP-Members(tm) is a trademark of butlerblog.com
*
* @package WordPress
* @subpackage WP-Members
* @author Chad Butler
* @copyright 2006-2015
*/
// If uninstall is not called from WordPress, kill the uninstall.
if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
die( 'invalid uninstall' );
}
// Uninstall process removes WP-Members settings from the WordPress database (_options table).
if ( WP_UNINSTALL_PLUGIN ) {
if( is_multisite() ) {
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 );
wpmem_uninstall_options();
}
switch_to_blog( $original_blog_id );
} else {
wpmem_uninstall_options();
}
}
/**
* Compartmentalizes uninstall
*
* @since 2.9.3
*/
function wpmem_uninstall_options() {
delete_option( 'wpmembers_settings' );
delete_option( 'wpmembers_fields' );
delete_option( 'wpmembers_dialogs' );
delete_option( 'wpmembers_captcha' );
delete_option( 'wpmembers_tos' );
delete_option( 'wpmembers_export' );
delete_option( 'wpmembers_utfields' );
delete_option( 'wpmembers_email_newreg' );
delete_option( 'wpmembers_email_newmod' );
delete_option( 'wpmembers_email_appmod' );
delete_option( 'wpmembers_email_repass' );
delete_option( 'wpmembers_email_footer' );
delete_option( 'wpmembers_email_notify' );
delete_option( 'wpmembers_email_wpfrom' );
delete_option( 'wpmembers_email_wpname' );
delete_option( 'widget_wpmemwidget' );
// For pre-3.x settings that may remain.
delete_option( 'wpmembers_msurl' );
delete_option( 'wpmembers_regurl' );
delete_option( 'wpmembers_logurl' );
delete_option( 'wpmembers_cssurl' );
delete_option( 'wpmembers_style' );
delete_option( 'wpmembers_autoex' );
delete_option( 'wpmembers_attrib' );
}
/** End of File **/