forked from discourse/wp-discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
36 lines (29 loc) · 1.03 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
<?php
/**
* Uninstall the plugin.
*
* @package WPDiscourse
*/
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
$discourse_options = get_option( 'discourse_option_groups' );
$discourse_options[] = 'discourse_configurable_text_backup';
$discourse_options[] = 'discourse_version';
$discourse_options[] = 'discourse_option_groups';
$discourse_options[] = 'wpdc_discourse_domain';
$discourse_options[] = 'wpdiscourse_nonce_db_version';
$discourse_options[] = 'wpdc_cached_html_keys';
foreach ( $discourse_options as $option ) {
delete_option( $option );
delete_site_option( $option );
}
delete_option( 'wpdc_discourse_categories' );
delete_option( 'wpdc_141_update_notice' );
// Todo: loop through blogs to delete options for each.
delete_site_option( 'wpdc_multisite_configuration' );
delete_site_option( 'wpdc_site_options' );
delete_site_option( 'wpdc_topic_blog_db_version' );
global $wpdb;
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}discourse_nonce" );
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->base_prefix}wpdc_topic_blog" );