Skip to content

Commit

Permalink
Remove deactivation hooks since they don't work in themes.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinsays committed May 15, 2011
1 parent d82edc1 commit cb68442
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
26 changes: 0 additions & 26 deletions admin/options-framework.php
Expand Up @@ -49,32 +49,6 @@ function optionsframework_rolescheck () {
}
}

/* Register plugin activation hooks */

register_activation_hook(__FILE__,'optionsframework_activation_hook');

function optionsframework_activation_hook() {
register_uninstall_hook( __FILE__, 'optionsframework_delete_options' );
}

/* When uninstalled, deletes options */

register_uninstall_hook( __FILE__, 'optionsframework_delete_options' );

function optionsframework_delete_options() {

$optionsframework_settings = get_option('optionsframework');

// Each theme saves its data in a seperate option, which all gets deleted
$knownoptions = $optionsframework_settings['knownoptions'];
if ($knownoptions) {
foreach ($knownoptions as $key) {
delete_option($key);
}
}
delete_option('optionsframework');
}

/*
* Creates the settings in the database by looping through the array
* we supplied in options.php. This is a neat way to do it since
Expand Down
6 changes: 5 additions & 1 deletion functions.php
@@ -1,5 +1,7 @@
<?php

if ( !function_exists( 'optionsframework_init' ) ) {

/*-----------------------------------------------------------------------------------*/
/* Options Framework Theme
/*-----------------------------------------------------------------------------------*/
Expand All @@ -14,4 +16,6 @@
define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('stylesheet_directory') . '/admin/');
}

require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');

}

0 comments on commit cb68442

Please sign in to comment.