Skip to main content

Getting the menu name of a theme location

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.