PluginProbe
Insert PHP Code Snippet / 1.4
Insert PHP Code Snippet v1.4
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.4, at admin/uninstall.php

44 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 ( ! defined( 'ABSPATH' ) )
3 exit;
4
5 function xyz_ips_network_uninstall($networkwide) {
6 global $wpdb;
7
8 if (function_exists('is_multisite') && is_multisite()) {
9 // check if it is a network activation - if so, run the activation function for each blog id
10 if ($networkwide) {
11 $old_blog = $wpdb->blogid;
12 // Get all blog ids
13 $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
14 foreach ($blogids as $blog_id) {
15 switch_to_blog($blog_id);
16 xyz_ips_uninstall();
17 }
18 switch_to_blog($old_blog);
19 return;
20 }
21 }
22 xyz_ips_uninstall();
23 }
24
25 function xyz_ips_uninstall(){
26
27 global $wpdb;
28 delete_option("xyz_ips_sort_order");
29 delete_option("xyz_ips_sort_field_name");
30 delete_option("xyz_ips_limit");
31 delete_option("xyz_ips_installed_date");
32 delete_option('xyz_ips_credit_dismiss');
33 delete_option("xyz_ips_exception_email");
34 delete_option("xyz_ips_exec_in_editor");
35 delete_option("xyz_ips_auto_insert");
36 /* table delete*/
37 $wpdb->query("DROP TABLE ".$wpdb->prefix."xyz_ips_short_code");
38
39
40 }
41
42 register_uninstall_hook( XYZ_INSERT_PHP_PLUGIN_FILE, 'xyz_ips_network_uninstall' );
43 ?>
44