How do I programmatically render a menu's label?
Here is the snippet to change the menu name:

 function example_preprocess_menu(&amp;$variables) {
      $element = &amp;$variables['items'];
      foreach ($element as &amp;$item) {
        if ($item['original_link']-&gt;getMenuName() == 'menu-machine-name') {
        //For the menu label    
       $menu = entity_load('menu', 'menu-machine-name');
          $menu_label = $menu-&gt;label(); 
          if ($item['title'] == 'Example menu') {
            $item['title'] = 'New menu name';
          }
        }
      }
    }