I am building a hierarchical menu of custom taxonomies and their related posts using wp_get_nav_menu_items as follow:
if( $locations = get_nav_menu_locations() && isset($locations['secondary']) ): $menu = wp_get_nav_menu_object( $locations['secondary'] ); $menu_items = wp_get_nav_menu_items( $menu->term_id ); foreach( (array) $menu_items as $key => $menu_item ): # access to $menu_item -> title; # access to $menu_item -> ID; # access to $menu_item -> object_id; # etc ... endforeach; endif; etc ...
Say I have a menu item called service (it is a term of custom taxonomy solutions_category), and from the Appearance -> Menus I changed its label to 'Our Services' through the Navigation Label. In this case $menu_item->title returns 'Our Services'. How can I get 'service' instead? Because I need it for a subsequent WP_Query to get all posts that belong to custom category 'service'
P.S. I can post full code if you need.