forked from msaari/relevanssi-premium-snowball-stemmer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
34 lines (30 loc) · 876 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
<?php
/**
* /uninstall.php
*
* @package Relevanssi Premium Snowball Stemmer
* @author Mikko Saari
* @license https://wordpress.org/about/gpl/ GNU General Public License
* @see https://www.relevanssi.com/snowball_stemmer/
*/
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
die;
}
global $wpdb;
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
$blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
$old_blogid = $wpdb->blogid;
foreach ( $blogids as $uninstall_blog_id ) {
switch_to_blog( $uninstall_blog_id );
relevanssi_premium_snowball_stemmer_uninstall();
restore_current_blog();
}
} else {
relevanssi_premium_snowball_stemmer_uninstall();
}
/**
* Removes Relevanssi Snowball Stemmer options.
*/
function relevanssi_premium_snowball_stemmer_uninstall() {
delete_option( 'relevanssi_premium_snowball_stemmer_language' );
}