PluginProbe
Catch Web Tools / 0.1
Catch Web Tools v0.1
trunk 0.1 0.2 0.3 0.4 1.0 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.6 1.7 1.8 1.8.1 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 All 58 releases
catch-web-tools / uninstall.php

uninstall.php in Catch Web Tools 0.1, at uninstall.php

54 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Catch_web_tools
4 * @version 1.0
5 * Code used when the plugin is removed (not just deactivated but actively deleted through the WordPress Admin).
6 */
7
8 if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
9 exit();
10
11 $options = array( 'catchwebtools_webmaster',
12 'catchwebtools_opengraph',
13 'catchwebtools_custom_css',
14 'catchwebtools_seo',
15 'catchwebtools_social',
16 'catchwebtools_catchids'
17 );
18
19 $transient_options = array( 'catchwebtools_webmaster_transient',
20 'catchwebtools_opengraph_transient',
21 'catchwebtools_custom_css_transient',
22 'catchwebtools_seo_transient',
23 'catchwebtools_social_transient',
24 'catchwebtools_catchids_transient'
25 );
26
27 // For Single site
28 if ( !is_multisite() )
29 {
30 foreach ( $options as $option) {
31 delete_option( $option );
32 }
33 foreach ( $transient_options as $option) {
34 delete_transient( $option );
35 }
36 }
37 // For Multisite
38 else
39 {
40 global $wpdb;
41 $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
42 $original_blog_id = get_current_blog_id();
43 foreach ( $blog_ids as $blog_id )
44 {
45 switch_to_blog( $blog_id );
46 foreach ( $options as $option) {
47 delete_site_option( $option );
48 }
49 foreach ( $transient_options as $option) {
50 delete_transient( $option );
51 }
52 }
53 switch_to_blog( $original_blog_id );
54 }