-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
35 lines (28 loc) · 863 Bytes
/
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
/**
* Yachtino boat listing
* @author Yachtino GmbH
* @package yachtino
* @since 1.0.0
*
* Fired when the plugin is uninstalled.
*
*/
// If uninstall not called from WordPress, then exit.
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
function yachtino_uninstall()
{
global $wpdb;
delete_option('yachtino_settings');
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'yachtino_routes');
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'yachtino_route_master');
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'yachtino_modules');
// delete PHP files/code from hard disc
$pathToPluginDir = __DIR__;
require_once __DIR__ . '/includes/api/class-yachtino-library.php';
Yachtino_Library::truncateDirectory($pathToPluginDir, true);
flush_rewrite_rules();
}
yachtino_uninstall();