I'm developing a plugin and I want to insert menu items programmatically.
When my theme creates a menu, it uses this call:
wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) );
Which resulted in something like this in the HTML:
<div class="nav-menu"><ul>
<li class="current_page_item"><a href="somewhere">menu-item-1</a></li>
<li class="page_item page-item-107"><a href="somewhere-else">menu item 2</a></li>
</ul></div>
I want to be able to intercept this somehow and insert my own HTML programmatically before the closing </ul>
. How do I hook it up?