blogid; // Get blog list and cycle through all blogs under network $blog_list = $wpdb->get_col( 'SELECT blog_id FROM ' . $wpdb->blogs ); foreach ( $blog_list as $blog ) { switch_to_blog( $blog ); // Call function to delete amms table with prefix wpamms_drop_table( $wpdb->get_blog_prefix() ); } switch_to_blog( $start_blog ); return; } } wpamms_drop_table( $wpdb->prefix ); function wpamms_drop_table( $prefix ) { global $wpdb; $wpdb->query( 'DROP TABLE ' . $prefix . 'amms_members' ); $wpdb->query( 'DROP TABLE ' . $prefix . 'amms_renewal' ); } // Check if options exist and delete them if present if ( get_option( 'wpamms_options' ) != false ) { delete_option( 'wpamms_options' ); } ?>