sticky); $sticky_settings = array('sticky_options'); ### Form Processing if(!empty($_POST['do'])) { // Decide What To Do switch($_POST['do']) { case __('Update Options', 'wp-sticky'): $text = ''; $sticky_options['display_date'] = intval($_POST['display_date']); $sticky_options['category_only'] = intval($_POST['category_only']); $sticky_options['announcement_banner'] = trim($_POST['announcement_banner']); $update_sticky_options = update_option('sticky_options', $sticky_options); if($update_sticky_options) { $text = ''.__('Sticky Options Updated', 'wp-sticky').''; } if(empty($text)) { $text = ''.__('No Sticky Option Updated', 'wp-sticky').''; } break; // Uninstall WP-Sticky case __('UNINSTALL WP-Sticky', 'wp-sticky') : if(trim($_POST['uninstall_sticky_yes']) == 'yes') { echo '
';
foreach($sticky_tables as $table) {
$wpdb->query("DROP TABLE {$table}");
echo '';
printf(__('Table \'%s\' has been deleted.', 'wp-sticky'), "{$table}");
echo '
';
}
echo '
';
foreach($sticky_settings as $setting) {
$delete_setting = delete_option($setting);
if($delete_setting) {
echo '';
printf(__('Setting Key \'%s\' has been deleted.', 'wp-sticky'), "{$setting}");
echo '
';
} else {
echo '';
printf(__('Error deleting Setting Key \'%s\'.', 'wp-sticky'), "{$setting}");
echo '
';
}
}
echo '
'.sprintf(__('Click Here To Finish The Uninstallation And WP-Sticky Will Be Deactivated Automatically.', 'wp-sticky'), $deactivate_url).'
'; echo ''.$text.'