-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
48 lines (42 loc) · 1.37 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
<?php
/**
* Uninstall CCBPress Core
*
* @package CCBPress Core
* @subpackage Uninstall
* @copyright Copyright (c) 2015, FireTree Design, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0.0
*/
// Exit if accessed directly.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
$ccbpress_settings = get_option( 'ccbpress_settings', array() );
if ( isset( $ccbpress_settings['remove_data'] ) ) {
// Delete the options.
delete_option( 'ccbpress_settings' );
delete_option( 'ccbpress_ccb' );
delete_option( 'ccbpress_licenses' );
delete_option( 'ccbpress_settings_import' );
delete_option( 'ccbpress_last_import' );
delete_option( 'ccbpress_import_in_progress' );
delete_option( 'ccbpress_settings_sync' );
delete_option( 'ccbpress_last_group_sync' );
delete_option( 'ccbpress_group_sync_in_progress' );
delete_option( 'ccbpress_last_event_sync' );
delete_option( 'ccbpress_event_sync_in_progress' );
delete_option( 'ccbpress_rate_limit' );
delete_option( 'ccbpress_cancel_import' );
delete_option( 'ccbpress_current_import' );
// Delete any left-over import jobs.
global $wpdb;
$table = $wpdb->options;
$column = 'option_name';
$key = 'wp_ccbpress_get_batch_%';
if ( is_multisite() ) {
$table = $wpdb->sitemeta;
$column = 'meta_key';
}
$wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE $column LIKE %s", $key ) );
}