-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
// Check that code was called from ClassicPress with uninstallation constant declared | ||
if (! defined('WP_UNINSTALL_PLUGIN')){ | ||
exit; | ||
} | ||
|
||
// Options to remove | ||
$options = array( | ||
'azrcrv-n' | ||
); | ||
|
||
// Remove from single site | ||
if (! is_multisite()){ | ||
|
||
foreach ($options as $option){ | ||
delete_option($option); | ||
} | ||
|
||
} | ||
// Remove from multi site | ||
else { | ||
global $wpdb; | ||
|
||
$blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); | ||
$original_blog_id = get_current_blog_id(); | ||
|
||
foreach ($blog_ids as $blog_id){ | ||
switch_to_blog($blog_id); | ||
|
||
foreach ($options as $option){ | ||
delete_option($option); | ||
} | ||
} | ||
|
||
switch_to_blog($original_blog_id); | ||
|
||
foreach ($options as $option){ | ||
delete_site_option($option); | ||
} | ||
} | ||
?> |