diff --git a/readme.txt b/readme.txt index a508784..dc2f914 100644 --- a/readme.txt +++ b/readme.txt @@ -81,6 +81,7 @@ Is this plugin prepared for multisites? Yes. * Added .gitignore. * Added security measurement to prevent the public to run the php-script directly. * Changed the registering of settings during installation to an array. +* Changed the unregistering of settings during uninstallation to an array. = 4.1.0 = * Compatibility with WordPress version 6.7.1 diff --git a/wp-jquery-datatable.php b/wp-jquery-datatable.php index e58b89d..e124693 100644 --- a/wp-jquery-datatable.php +++ b/wp-jquery-datatable.php @@ -391,13 +391,19 @@ function wp_jdt_shortcode($atts, $content = "") register_uninstall_hook(__FILE__, 'wp_jdt_uninstall'); // uninstall plug-in function wp_jdt_uninstall() { - delete_option('wp_jdt_info'); - delete_option('wp_jdt_paging'); - delete_option('wp_jdt_page_length'); - delete_option('wp_jdt_paging_type'); - delete_option('wp_jdt_b_length_change'); - delete_option('wp_jdt_ordering'); - delete_option('wp_jdt_order_row'); - delete_option('wp_jdt_order_row_sort'); - delete_option('wp_jdt_searching'); + $settings = array( + 'wp_jdt_info', + 'wp_jdt_paging', + 'wp_jdt_page_length', + 'wp_jdt_paging_type', + 'wp_jdt_b_length_change', + 'wp_jdt_ordering', + 'wp_jdt_order_row', + 'wp_jdt_order_row_sort', + 'wp_jdt_searching' + ); + + foreach ($settings as $setting) { + delete_option($setting); + } }