From 478be700fc707c1bbf42c740300b879166d2e891 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Tue, 8 Apr 2025 01:25:26 +0100 Subject: [PATCH] [FIX] Resolve toggle switch functionality in UI enhancements --- admin/css/wp-allstars-ui-enhancements.css | 14 ++- .../class-wp-allstars-ui-enhancements.php | 116 ++++++++++-------- 2 files changed, 76 insertions(+), 54 deletions(-) diff --git a/admin/css/wp-allstars-ui-enhancements.css b/admin/css/wp-allstars-ui-enhancements.css index 9859fb2..abfd71a 100644 --- a/admin/css/wp-allstars-ui-enhancements.css +++ b/admin/css/wp-allstars-ui-enhancements.css @@ -208,13 +208,17 @@ margin-right: 8px; } -.wp-toggle-switch input { +.wp-toggle-switch input[type="checkbox"] { opacity: 0; - width: 0; - height: 0; + width: 100%; + height: 100%; position: absolute; - z-index: 1; + z-index: 2; cursor: pointer; + margin: 0; + padding: 0; + top: 0; + left: 0; } .wp-toggle-slider { @@ -227,6 +231,7 @@ background-color: #ccc; transition: .3s; border-radius: 34px; + z-index: 1; } .wp-toggle-slider:before { @@ -262,7 +267,6 @@ input:checked + .wp-toggle-slider:before { .wp-allstars-enhanced-ui .wp-toggle-slider { border-radius: 24px; background-color: #ccc; - transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); } .wp-allstars-enhanced-ui .wp-toggle-slider:before { diff --git a/includes/class-wp-allstars-ui-enhancements.php b/includes/class-wp-allstars-ui-enhancements.php index e660eb1..baed8b9 100644 --- a/includes/class-wp-allstars-ui-enhancements.php +++ b/includes/class-wp-allstars-ui-enhancements.php @@ -103,11 +103,27 @@ class WP_Allstars_UI_Enhancements { return; } + // Get the nonce value + $nonce = wp_create_nonce('wp-allstars-nonce'); + ?>