PluginProbe
Statify / 1.4.1
Statify v1.4.1
2.0.2 2.0.1 trunk 0.7 0.8 0.9 1.0 1.2.8 1.3.0 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 All 32 releases
statify / inc / statify_uninstall.class.php

statify_uninstall.class.php in Statify 1.4.1, at inc/statify_uninstall.class.php

96 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 /* Quit */
5 defined('ABSPATH') OR exit;
6
7
8 /**
9 * Statify_Uninstall
10 *
11 * @since 0.1
12 */
13
14 class Statify_Uninstall
15 {
16
17
18 /**
19 * Uninstallation auch für MU-Blog
20 *
21 * @since 0.1.0
22 * @change 0.1.0
23 *
24 * @param integer ID des Blogs
25 */
26
27 public static function init($id)
28 {
29 /* Global */
30 global $wpdb;
31
32 /* Neuer MU-Blog */
33 if ( ! empty($id) ) {
34 /* Im Netzwerk? */
35 if ( ! is_plugin_active_for_network(STATIFY_BASE) ) {
36 return;
37 }
38
39 /* Wechsel */
40 switch_to_blog( (int)$id );
41
42 /* Installieren */
43 self::_apply();
44
45 /* Wechsel zurück */
46 restore_current_blog();
47
48 /* Raus */
49 return;
50 }
51
52 /* Multisite & Network */
53 if ( is_multisite() && ! empty($_GET['networkwide']) ) {
54 /* Alter Blog */
55 $old = $wpdb->blogid;
56
57 /* Blog-IDs */
58 $ids = $wpdb->get_col("SELECT blog_id FROM `$wpdb->blogs`");
59
60 /* Loopen */
61 foreach ($ids as $id) {
62 switch_to_blog($id);
63 self::_apply();
64 }
65
66 /* Wechsel zurück */
67 switch_to_blog($old);
68
69 /* Raus */
70 return;
71 }
72
73 /* Single-Blog */
74 self::_apply();
75 }
76
77
78 /**
79 * Löschung der Daten
80 *
81 * @since 0.1.0
82 * @change 1.4.0
83 */
84
85 private static function _apply()
86 {
87 /* Delete options */
88 delete_option('statify');
89
90 /* Init table */
91 Statify_Table::init();
92
93 /* Delete table */
94 Statify_Table::drop();
95 }
96 }