From 00fe1adc15ea7646596d755f6e6e1f7854ffc1d5 Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 10 Mar 2025 10:48:12 +0100 Subject: [PATCH] Fix: add possibility to remove all menu items --- admin/pages/menus.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/pages/menus.php b/admin/pages/menus.php index e2608b0b..572be25e 100644 --- a/admin/pages/menus.php +++ b/admin/pages/menus.php @@ -27,11 +27,11 @@ $pluginThemes = Plugins::getThemes(); if (isset($_POST['template'])) { $template = $_POST['template']; - if (isset($_POST['menu'])) { - $post_menu = $_POST['menu']; - $post_menu_link = $_POST['menu_link']; - $post_menu_blank = $_POST['menu_blank']; - $post_menu_color = $_POST['menu_color']; + if (isset($_POST['save'])) { + $post_menu = $_POST['menu'] ?? []; + $post_menu_link = $_POST['menu_link'] ?? []; + $post_menu_blank = $_POST['menu_blank'] ?? []; + $post_menu_color = $_POST['menu_color'] ?? []; if (count($post_menu) != count($post_menu_link)) { echo 'Menu count is not equal menu links. Something went wrong when sending form.'; return; @@ -135,7 +135,7 @@ if (isset($_POST['template'])) {