PluginProbe
Catch Web Tools / 3.1
Catch Web Tools v3.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 3.1, at uninstall.php

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