Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to access the name of menu in worpress

$menu_location = 'header';

$menu_locations = get_nav_menu_locations();

$menu_object = (isset($menu_locations[$menu_location]) ? wp_get_nav_menu_object($menu_locations[$menu_location]) : null);

$menu_name = (isset($menu_object->name) ? $menu_object->name : '');

echo esc_html($menu_name);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #access #menu #worpress
ADD COMMENT
Topic
Name
8+7 =