PluginProbe
Uji Countdown / trunk
Uji Countdown vtrunk
3.0 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 36 releases
uji-countdown / uninstall.php

uninstall.php in Uji Countdown trunk, at uninstall.php

40 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // If uninstall not called from WordPress, then exit
3 if (!defined('WP_UNINSTALL_PLUGIN')) {
4 exit();
5 }
6
7 /**
8 * Uninstall operations
9 */
10 function single_uninstall() {
11 // delete subscribers table
12 $GLOBALS['wpdb']->query("DROP TABLE IF EXISTS {$GLOBALS['wpdb']->prefix}uji_counter");
13 $GLOBALS['wpdb']->query("DROP TABLE IF EXISTS {$GLOBALS['wpdb']->prefix}uji_subscriptions");
14
15 // delete options
16 delete_option('ujic_set');
17 }
18
19 $_set = get_option('ujic_set');
20 $delete_set = (isset( $_set['ujic_remove'] ) && !empty( $_set['ujic_remove'] ) ) ? $_set['ujic_remove'] : false;
21
22 if( $delete_set == "true" ):
23 // Let's do it!
24 if (is_multisite()) {
25 single_uninstall();
26
27 // delete data foreach blog
28 $blogs_list = $GLOBALS['wpdb']->get_results("SELECT blog_id FROM {$GLOBALS['wpdb']->blogs}", ARRAY_A);
29 if (!empty($blogs_list)) {
30 foreach ($blogs_list as $blog) {
31 switch_to_blog($blog['blog_id']);
32 single_uninstall();
33 restore_current_blog();
34 }
35 }
36 } else {
37 single_uninstall();
38 }
39
40 endif;