PluginProbe
Insert PHP Code Snippet / 1.2
Insert PHP Code Snippet v1.2
1.4.7 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 All 27 releases
insert-php-code-snippet / admin / uninstall.php

uninstall.php in Insert PHP Code Snippet 1.2, at admin/uninstall.php

38 lines 869 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function xyz_ips_network_uninstall($networkwide) {
4 global $wpdb;
5
6 if (function_exists('is_multisite') && is_multisite()) {
7 // check if it is a network activation - if so, run the activation function for each blog id
8 if ($networkwide) {
9 $old_blog = $wpdb->blogid;
10 // Get all blog ids
11 $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
12 foreach ($blogids as $blog_id) {
13 switch_to_blog($blog_id);
14 xyz_ips_uninstall();
15 }
16 switch_to_blog($old_blog);
17 return;
18 }
19 }
20 xyz_ips_uninstall();
21 }
22
23 function xyz_ips_uninstall(){
24
25 global $wpdb;
26 delete_option("xyz_ips_sort_order");
27 delete_option("xyz_ips_sort_field_name");
28 delete_option("xyz_ips_limit");
29
30 /* table delete*/
31 $wpdb->query("DROP TABLE ".$wpdb->prefix."xyz_ips_short_code");
32
33
34 }
35
36 register_uninstall_hook( XYZ_INSERT_PHP_PLUGIN_FILE, 'xyz_ips_network_uninstall' );
37 ?>
38