Skip to:
Content

BuddyPress.org

Ticket #2755: bp_uninstaller.patch

File bp_uninstaller.patch, 1.2 KB (added by ddean, 13 years ago)

uninstall.php proposal

  • uninstall.php

     
     1<?php
     2/**
     3 * BuddyPress Uninstaller
     4 */
     5if ( !defined( 'BP_PLUGIN_DIR' ) )
     6        define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
     7
     8// Load core
     9require( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
     10require( BP_PLUGIN_DIR . '/bp-core/bp-core-loader.php' );
     11
     12function bp_unloader_delete_site_options() {
     13        if ( !function_exists( 'delete_site_option') )
     14                return false;
     15       
     16        delete_site_option( 'bp-core-db-version' );
     17        delete_site_option( 'bp-activity-db-version' );
     18        delete_site_option( 'bp-blogs-db-version' );
     19        delete_site_option( 'bp-friends-db-version' );
     20        delete_site_option( 'bp-groups-db-version' );
     21        delete_site_option( 'bp-messages-db-version' );
     22        delete_site_option( 'bp-xprofile-db-version' );
     23        delete_site_option( 'bp-deactivated-components' );
     24        delete_site_option( 'bp-blogs-first-install' );
     25       
     26}
     27
     28function bp_unloader_delete_tables() {
     29        /** Delete table created by BP? */
     30}
     31
     32bp_unloader_delete_site_options();
     33bp_unloader_delete_tables();
     34
     35?>
     36 No newline at end of file