Permalink
Browse files

Added uninstall for settings options in options table.

  • Loading branch information...
1 parent ad4deca commit f389aed3a9be5b36af02348c223b6fa7273ce8be @JLeuze committed Jun 4, 2011
Showing with 43 additions and 28 deletions.
  1. +0 −28 includes/meteor-slides-admin.php
  2. +28 −0 meteor-slides-plugin.php
  3. +15 −0 uninstall.php
@@ -328,34 +328,6 @@ function meteorslides_register_settings() {
}
- // Adds default values for options on settings page
-
- register_activation_hook( __FILE__, 'meteorslides_default_options' );
-
- function meteorslides_default_options() {
-
- $tmp = get_option( 'meteorslides_options' );
-
- if ( ( $tmp['slideshow_quantity']=='' )||( !is_array( $tmp ) ) ) {
-
- $arr = array(
-
- 'slideshow_quantity' => '5',
- 'slide_height' => '200',
- 'slide_width' => '940',
- 'transition_style' => 'fade',
- 'transition_speed' => '2',
- 'slide_duration' => '5',
- 'slideshow_navigation' => 'navnone'
-
- );
-
- update_option( 'meteorslides_options', $arr );
-
- }
-
- }
-
// Validates values for options on settings page
function meteorslides_options_validate( $input ) {
View
@@ -231,6 +231,34 @@ function meteorslides_settings_link( $links, $file ) {
}
+ // Adds default values for options on settings page
+
+ register_activation_hook( __FILE__, 'meteorslides_default_options' );
+
+ function meteorslides_default_options() {
+
+ $tmp = get_option( 'meteorslides_options' );
+
+ if ( ( $tmp['slideshow_quantity']=='' )||( !is_array( $tmp ) ) ) {
+
+ $arr = array(
+
+ 'slideshow_quantity' => '5',
+ 'slide_height' => '200',
+ 'slide_width' => '940',
+ 'transition_style' => 'fade',
+ 'transition_speed' => '2',
+ 'slide_duration' => '5',
+ 'slideshow_navigation' => 'navnone'
+
+ );
+
+ update_option( 'meteorslides_options', $arr );
+
+ }
+
+ }
+
// Adds function to load slideshow in theme
function meteor_slideshow( $slideshow='', $metadata='' ) {
View
@@ -0,0 +1,15 @@
+<?php
+
+ // If uninstall not called from WordPress exit
+
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
+
+ exit();
+
+ }
+
+ // Delete settings page options from options table
+
+ delete_option( 'meteorslides_options' );
+
+?>

0 comments on commit f389aed

Please sign in to comment.