Permalink
Browse files

delete data on uninstall rather than deactivation

  • Loading branch information...
1 parent b341789 commit 331284d402e13c6d03ab7aa31fb9008749512682 @billerickson committed Jul 4, 2012
Showing with 12 additions and 14 deletions.
  1. +0 −13 lib/ns_tmo_plugin.class.php
  2. +1 −1 term-menu-order.php
  3. +11 −0 uninstall.php
@@ -20,8 +20,6 @@ private function __construct () {
register_activation_hook(self::$plugin_path, array(&$this, 'activate'));
- register_deactivation_hook(self::$plugin_path, array(&$this, 'deactivate'));
-
add_action('init', array(&$this, 'init'));
self::load_text_domain();
@@ -129,18 +127,7 @@ public function activate () {
$wpdb->query($sql);
}
-
- public function deactivate () {
-
- global $wpdb;
-
- $sql = "ALTER TABLE `{$wpdb->terms}` DROP COLUMN `menu_order`;";
- $wpdb->query($sql);
-
- }
-
-
public function init () {
self::$taxonomies = apply_filters( 'term_menu_order_taxonomies', get_taxonomies() );
View
@@ -2,7 +2,7 @@
/*
Plugin Name: Term Menu Order
Plugin URI: https://github.com/kalchas
-Description:
+Description: Creates a 'menu_order' column to specify term order, allowing theme and plugin developers to sort term by menu order.
Author: James Lafferty
Version: 0.3.1
Author URI: https://github.com/kalchas
View
@@ -0,0 +1,11 @@
+<?php
+
+//if uninstall not called from WordPress exit
+if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
+ exit ();
+
+// Remove the 'menu_order' column
+global $wpdb;
+$sql = "ALTER TABLE `{$wpdb->terms}` DROP COLUMN `menu_order`;";
+$wpdb->query( $sql );
+

0 comments on commit 331284d

Please sign in to comment.