-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
46 lines (42 loc) · 1.02 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
<?php
/**
* Loads when the plugin is uninstalled
*
* Only removes options for the time being.
* Plugins can use the 'multilocale_before_uninstall_plugin' hook.
*
* @package Multilocale
* @author Barry Ceelen <[email protected]>
* @link https://github.com/barryceelen/multilocale
* @copyright 2016 Barry Ceelen
* @license GPLv3+
*/
if (
! defined( 'WP_UNINSTALL_PLUGIN' )
||
! WP_UNINSTALL_PLUGIN
||
dirname( WP_UNINSTALL_PLUGIN ) !== dirname( plugin_basename( __FILE__ ) )
) {
status_header( 404 );
exit;
}
/**
* Fires before the plugin uninstall routine runs.
*
* @since 0.0.1
*/
do_action( 'multilocale_before_uninstall_plugin' );
/*
* Remove options.
*
* Note: Do this last, the options might be needed for handling other stuff.
*/
$multilocale_uninstall_option_names = array(
'plugin_multilocale',
'plugin_multilocale_version',
);
foreach ( $multilocale_uninstall_option_names as $multilocale_option_name ) {
delete_option( $multilocale_option_name );
delete_site_option( $multilocale_option_name );
}