Here is the real picture I want to produce.
<ul>
<li>
<ul>
<li> </li>
<li> </li>
###NOT HERE ###
</ul>
</Ii>
###I want to add some html here ###
</ul>
I am trying as follows:
public function end_lvl( &$output, $depth = 0, $args = array() ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
} else {
$t = "\t";
$n = "\n";
}
$indent = str_repeat( $t, $depth );
$output .= "$indent".get_search_form(false)."</ul>{$n}";
}
But it appended the search box at the end of every sub menu(###NOT HERE ### section). How can I achieve the desired output. Any idea?