Hiding menu item in a MYMODULE_preprocess_menu() hook has no effect

Created on 28 March 2024, 9 months ago

Problem/Motivation

I am trying to hide a menu item with unset($variables['items'][$key]); in a MYMODULE_preprocess_menu() hook based on some custom criteria specific to a logged in user. The code in the hook function runs, but it has no effect on the menu. I even tried changing a title or other attributes but still no effect.

Steps to reproduce

1. Create a TB Mega Menu menu based on main menu.
2. In your custom theme or in a module create a MYMODULE_preprocess_menu() function and in that function manipulate a menu item.

πŸ› Bug report
Status

Active

Version

1.7

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States adanielyan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024