PluginProbe
Module Control for Jetpack / 1.7.2
Module Control for Jetpack v1.7.2
1.7.4 1.7.3 trunk 0.4 1.0 1.2 1.3 1.4 1.4.1 1.4.2 1.5 1.6 1.7 1.7.1 1.7.2
jetpack-module-control / uninstall.php

uninstall.php in Module Control for Jetpack 1.7.2, at uninstall.php

46 lines 984 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Uninstall Module Control for Jetpack
4 *
5 * @package JMC
6 */
7
8 // Exit if uninstall not called from WordPress.
9 defined( 'WP_UNINSTALL_PLUGIN' ) || exit();
10
11 $default_options = array(
12 'jetpack_mc_manual_control',
13 'jetpack_mc_development_mode',
14 'jetpack_mc_blacklist',
15 );
16
17 if ( is_multisite() ) {
18 // Get sites in the network.
19 $args = array(
20 'fields' => 'ids',
21 'number' => 1000, // Limit to 1000 sites.
22 'update_site_meta_cache' => false,
23 );
24 $blogs = get_sites( $args );
25
26 foreach ( $blogs as $_id ) {
27 switch_to_blog( $_id );
28 // Remove site options.
29 foreach ( $default_options as $option ) {
30 delete_option( $option );
31 }
32 restore_current_blog();
33 }
34
35 // Remove network options.
36 foreach ( $default_options as $option ) {
37 delete_site_option( $option );
38 }
39 delete_site_option( 'jetpack_mc_subsite_override' );
40 } else {
41 // Remove site options.
42 foreach ( $default_options as $option ) {
43 delete_option( $option );
44 }
45 }
46