From 51933246252f1c6bd56a917f896e7b31322ee9d5 Mon Sep 17 00:00:00 2001 From: Michel Date: Tue, 21 Jul 2026 17:32:21 +0200 Subject: [PATCH] Added a check for the options page to only load if the user has sufficient rights --- readme.txt | 1 + wp-jquery-datatable.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/readme.txt b/readme.txt index b054464..258bdd3 100644 --- a/readme.txt +++ b/readme.txt @@ -84,6 +84,7 @@ Is this plugin prepared for multisites? Yes. * Changed the unregistering of settings during uninstallation to an array. * Deleted the setting of unnecessary variables under wp_jdt_activate_plugin() and made all the if statements strict. * Changed the user role for the options page from 'administrator' to 'manage_options'. +* Added a check for the options page to only load if the user has sufficient rights. = 4.1.0 = * Compatibility with WordPress version 6.7.1 diff --git a/wp-jquery-datatable.php b/wp-jquery-datatable.php index 3e3b6de..4a0bee6 100644 --- a/wp-jquery-datatable.php +++ b/wp-jquery-datatable.php @@ -75,6 +75,10 @@ function wp_jdt_settings() function wp_jdt_settings_page() { // Admin side page options + if (!current_user_can('manage_options')) { + return; + } + $wp_jdt_info = get_option('wp_jdt_info'); $wp_jdt_paging = get_option('wp_jdt_paging'); $wp_jdt_page_length = get_option('wp_jdt_page_length');