Plugin Directory

source: code-engine/trunk/uninstall.php

Last change on this file was 3394202, checked in by TigrouMeow, 5 months ago

Version 0.4.0.

File size: 806 bytes
Line 
1<?php
2if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
3    die;
4}
5
6function mwcode_remove_database() {
7        global $wpdb;
8        $table_name1 = $wpdb->prefix . "mwcode_snippets";
9        $sql = "DROP TABLE IF EXISTS $table_name1";
10        $wpdb->query( $sql );
11
12       
13}
14
15function mwcode_remove_options() {
16
17        // Delete the options
18        $option_functions = 'mwcode_functions';
19    $option_intervals = 'mwcode_intervals';
20        $options = 'mwcode_options';
21
22        delete_option( $options );
23        delete_option( $option_functions );
24        delete_option( $option_intervals );
25}
26
27function mwcode_uninstall () {
28        $options = get_option( 'mwcode_options' );
29        $cleanUninstall = array_key_exists( 'clean_uninstall', $options ) ? $options['clean_uninstall'] : false;
30
31        if ( $cleanUninstall ) {
32                mwcode_remove_options();
33                mwcode_remove_database();
34        }
35
36}
37
38mwcode_uninstall();
Note: See TracBrowser for help on using the repository browser.