- Bugfix: uninstall function to really remove all settings done in the settings page

- Bugfix: load default settings after plugin is installed

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@919395 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-05-22 13:33:57 +00:00
parent a42f55165a
commit ca2c42eeaa
5 changed files with 29 additions and 46 deletions

View file

@ -36,13 +36,6 @@ class Class_Footnotes
add_action('init', array($this, 'init'));
add_action('admin_init', array($this, 'admin_init'));
add_action('admin_menu', array($this, 'admin_menu'));
/* register hook for activating the plugin */
register_activation_hook(__FILE__, array($this, 'activate'));
/* register hook for deactivating the plugin */
register_deactivation_hook(__FILE__, array($this, 'deactivate'));
/* register hook for uninstalling the plugin */
register_uninstall_hook(__FILE__, array($this, 'uninstall'));
}
/**
@ -70,7 +63,21 @@ class Class_Footnotes
*/
function uninstall()
{
require_once(dirname(__FILE__) . '/../includes/uninstall.php');
/* uninstalling the plugin is only allowed for logged in users */
if (!is_user_logged_in()) {
wp_die(__('You must be logged in to run this script.', FOOTNOTES_PLUGIN_NAME));
}
/* current user needs the permission to (un)install plugins */
if (!current_user_can('install_plugins')) {
wp_die(__('You do not have permission to run this script.', FOOTNOTES_PLUGIN_NAME));
}
/*
* delete the settings container in the database
* @since 1.0.6
*/
delete_option(FOOTNOTE_SETTINGS_CONTAINER);
}
/**