For our code sample with starting with something simple. Sometimes you want to give the user the control to change the menu name in the template. Currently WordPress doesn’t have a function where you can pass the theme location but it’s quite simple to do with a few lines of code.
It’s using two WordPress functions to retrieve all the menu locations and getting the specific menu object. By doing that you have the menu object and you can getting the menu name. So when a user want’s to change it, it now can go to Appearance ->Menus.