diff --git a/inc/WPUBaseSettings/WPUBaseSettings.php b/inc/WPUBaseSettings/WPUBaseSettings.php
index 178f09e..127e97c 100644
--- a/inc/WPUBaseSettings/WPUBaseSettings.php
+++ b/inc/WPUBaseSettings/WPUBaseSettings.php
@@ -1,10 +1,10 @@
' . __('Check all', __NAMESPACE__) . '';
+ $check_label = __('Check all', __NAMESPACE__);
+ $section['after_section'] .= '';
if (!$has_check_all) {
$has_check_all = true;
add_action('admin_footer', array(&$this, 'admin_footer_checkall'));
@@ -582,9 +583,26 @@ function admin_footer_checkall() {
echo <<
jQuery(document).ready(function() {
- jQuery(".wpubasesettings-check-all").on("click", function(e) {
- e.preventDefault();
- jQuery(this).prev(".form-table").find(":checkbox").prop("checked", true);
+ jQuery(".wpubasesettings-check-all").each(function() {
+ var _btn = jQuery(this),
+ _table = _btn.prev(".form-table"),
+ _checkboxes = _table.find(":checkbox"),
+ _check_all = true;
+
+ _btn.on("click", function(e) {
+ e.preventDefault();
+ _checkboxes.prop("checked", _check_all);
+ _checkboxes.trigger("change");
+ });
+
+ function check_checkboxes_mode() {
+ var _checked = _checkboxes.filter(":checked").length;
+ _check_all = _checked < _checkboxes.length;
+ _btn.text(_check_all ? _btn.data("check-label") : _btn.data("uncheck-label"));
+ }
+ _checkboxes.on("change", check_checkboxes_mode);
+ check_checkboxes_mode();
+
});
});
diff --git a/wpubaseplugin.php b/wpubaseplugin.php
index 349e116..0d29397 100644
--- a/wpubaseplugin.php
+++ b/wpubaseplugin.php
@@ -5,7 +5,7 @@
Plugin URI: https://github.com/WordPressUtilities/wpubaseplugin
Update URI: https://github.com/WordPressUtilities/wpubaseplugin
Description: A framework for a WordPress plugin
-Version: 2.79.0
+Version: 2.80.0
Author: Darklg
Author URI: https://darklg.me/
Text Domain: wpubaseplugin
@@ -20,7 +20,7 @@
class WPUBasePlugin {
- public $version = '2.79.0';
+ public $version = '2.80.0';
private $utilities_classes = array(
'messages' => array(
@@ -36,7 +36,7 @@ class WPUBasePlugin {
'name' => 'WPUBaseAdminPage'
),
'settings' => array(
- 'namespace' => 'wpubasesettings_0_20_0',
+ 'namespace' => 'wpubasesettings_0_21_0',
'name' => 'WPUBaseSettings'
),
'cron' => array(