-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathuninstall.php
More file actions
40 lines (31 loc) · 729 Bytes
/
uninstall.php
File metadata and controls
40 lines (31 loc) · 729 Bytes
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
<?php
/**
* Uninstaller
*
* Uninstall the plugin by removing any options from the database.
*
* @package simple-embed-code
*/
// If the uninstall was not called by WordPress, exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
// Delete any options.
if ( is_multisite() ) {
// Loop through every sub-site and remove its options.
$sites = get_sites(
array(
'fields' => 'ids',
),
);
foreach ( $sites as $site_id ) {
switch_to_blog( $site_id );
delete_option( 'artiss_code_embed' );
delete_option( 'code_embed_version' );
restore_current_blog();
}
} else {
// Delete options for a single site installation.
delete_option( 'artiss_code_embed' );
delete_option( 'code_embed_version' );
}