From 3e2a338fbcd99bbd9d3d5afabdaa3418a980f737 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 18 Dec 2023 17:07:34 +0100 Subject: [PATCH] v 3.10.3 - add support for classnames in wputh_get_menu_items helper. --- inc/theme/utilities/menus.php | 11 +++++++++-- package.json | 2 +- style.css | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/inc/theme/utilities/menus.php b/inc/theme/utilities/menus.php index 4fd3e09..ea49864 100644 --- a/inc/theme/utilities/menus.php +++ b/inc/theme/utilities/menus.php @@ -127,10 +127,17 @@ function wputh_get_menu_items($menu_id, $args = array()) { $attributes = ''; if ($item->xfn) { - $attributes .= ' rel="' . $item->xfn . '"'; + $attributes .= ' rel="' . esc_attr($item->xfn) . '"'; } if ($item->target) { - $attributes .= ' target="' . $item->target . '"'; + $attributes .= ' target="' . esc_attr($item->target) . '"'; + } + + if ($item->classes) { + $item_classname = trim(implode(' ', $item->classes)); + if ($item_classname) { + $attributes .= ' class="' . esc_attr($item_classname) . '"'; + } } $menu_items[] = '' . $item->title . ''; } diff --git a/package.json b/package.json index 2ecc9b4..7ab97f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wputheme", - "version": "3.10.2", + "version": "3.10.3", "description": "WPUTheme", "dependencies": {}, "devDependencies": { diff --git a/style.css b/style.css index 082981e..b7db198 100644 --- a/style.css +++ b/style.css @@ -3,7 +3,7 @@ Theme Name: WP Utilities Base Theme Theme URI: https://github.com/WordPressUtilities/WPUTheme Update URI: https://github.com/WordPressUtilities/WPUTheme Description: A Framework WordPress Theme -Version: 3.10.2 +Version: 3.10.3 Author: Darklg Author URI: https://darklg.me/ License: GPLv2 or later