Plugin Directory

Changeset 429550


Ignore:
Timestamp:
08/27/2011 08:52:13 PM (15 years ago)
Author:
lukeuk
Message:

added uninstaller

Location:
post-miner/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • post-miner/trunk/PostMiner/Hooks.php

    r429538 r429550  
    4646        PostMiner_Installer::install();
    4747    }
    48    
    49    
    50     /**
    51      * PostMiner uninstall hook
    52      *
    53      * @todo drop PostMiner tables on uninstall
    54      *
    55      * @return void
    56      */
    57     public function hookUninstall()
    58     {
    59         if ( !current_user_can('delete_plugins') )
    60         {
    61             wp_die('Insufficient permissions');
    62         }
    63        
    64         require_once POST_MINER__PATH . 'Installer.php';
    65        
    66         PostMiner_Installer::uninstall();
    67     }
     48
    6849   
    6950    /**
  • post-miner/trunk/PostMiner/Installer.php

    r429538 r429550  
    5353    static function install()
    5454    {
    55         require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    5655        require_once( POST_MINER__PATH . 'Indexer.php' );
    5756       
     
    6059        $prefix = $wpdb->prefix . 'postminer';
    6160       
    62         dbDelta( sprintf( self::$SQL_TERMS, $prefix ) );
    63         dbDelta( sprintf( self::$SQL_TERMS_RELATION, $prefix ) );
     61        $wpdb->get_request( sprintf( self::$SQL_TERMS, $prefix ) );
     62        $wpdb->get_request( sprintf( self::$SQL_TERMS_RELATION, $prefix ) );
    6463       
    6564        add_option("post-miner_db_version", '1.0.0');
     
    8079    static function uninstall()
    8180    {
    82         require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    83         require_once( POST_MINER__PATH . 'Indexer.php' );
    84        
    8581        global $wpdb;
    8682       
    8783        $prefix = $wpdb->prefix . 'postminer';
    8884       
    89         dbDelta( sprintf( self::$SQL_DROP_TERMS, $prefix ) );
    90         dbDelta( sprintf( self::$SQL_DROP_TERMS_RELATION, $prefix ) );
     85        $wpdb->get_request( sprintf( self::$SQL_DROP_TERMS, $prefix ) );
     86        $wpdb->get_request( sprintf( self::$SQL_DROP_TERMS_RELATION, $prefix ) );
    9187       
    9288        delete_option("post-miner_db_version");
  • post-miner/trunk/PostMiner/Plugin.php

    r429538 r429550  
    6262        }
    6363       
    64         /**
    65          * register activation/uninstall hooks
    66          */
    6764        if( method_exists( $this->hooks, 'hookActivation' ) )
    6865        {
    6966            register_activation_hook( POST_MINER__FILE, array( $this, '_hookActivation') );
    7067        }
    71        
    72         if( method_exists( $this->hooks, 'hookUninstall' ) )
    73         {
    74             register_uninstall_hook( POST_MINER__FILE, array( $this, '_hookUninstall') );
    75         }
     68
    7669    }
    7770   
Note: See TracChangeset for help on using the changeset viewer.