wp-smushit
Last commit date
JSON
17 years ago
assets
11 years ago
languages
11 years ago
lib
11 years ago
license.txt
17 years ago
readme.txt
11 years ago
screenshot-1.jpg
11 years ago
uninstall.php
11 years ago
wp-smushit.php
11 years ago
uninstall.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Remove plugin settings data |
| 4 | * |
| 5 | * @since 1.7 |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | //if uninstall not called from WordPress exit |
| 10 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 11 | exit(); |
| 12 | } |
| 13 | global $wpdb; |
| 14 | |
| 15 | $smushit_keys = array( |
| 16 | 'smushit_auto', |
| 17 | 'smushit_timeout', |
| 18 | 'smushit_enforce_same_url', |
| 19 | 'smushit_debug', |
| 20 | 'error_log', |
| 21 | 'notice_log' |
| 22 | ); |
| 23 | foreach ( $smushit_keys as $key ) { |
| 24 | $key = 'wp_smushit_' . $key; |
| 25 | if ( is_multisite() ) { |
| 26 | $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A ); |
| 27 | if ( $blogs ) { |
| 28 | foreach ( $blogs as $blog ) { |
| 29 | switch_to_blog( $blog['blog_id'] ); |
| 30 | delete_option( $key ); |
| 31 | delete_site_option( $key ); |
| 32 | } |
| 33 | restore_current_blog(); |
| 34 | } |
| 35 | } else { |
| 36 | delete_option( $key ); |
| 37 | } |
| 38 | } |
| 39 | ?> |