How can I make a Menu Block not auto-expand the current page's menu links?
I'm currently doing this with hook_menu_block_alter() calling itself recursively:

function THEME_NAME_menu_block_tree_alter(&amp;$tree, &amp;$config) {
    if($config['expanded']) {
        return;
    }

    foreach($tree as $link_key =&gt; &amp;$link) {
        if(!empty($link['below'])) {
            if(!$link['link']['expanded']) {
                $link['below'] = array();
            } else {
                THEME_NAME_menu_block_tree_alter($link['below'], $config);
            }
        }
    }

    unset($link);
}


But this feels super sketchy and I'm not at all confident that it's the best solution. I could break the foreach() into a separate recursive function, but that hardly seems different, other than my general icky feeling which I'm not sure there's even a logical reason for me to have.