The menu item's starting output only includes $args->before, the opening <a>, the menu item's title, the closing </a>, and $args->after. Currently, there is no filter for modifying the opening and closing <li> for a menu item.
297<?php298 *299 * @param string $item_output The menu item's starting HTML output.300 * @param WP_Post $menu_item Menu item data object.301 * @param int $depth Depth of menu item. Used for padding.302 * @param stdClass $args An object of wp_nav_menu() arguments.303 */304 $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $menu_item, $depth, $args );305 }306307 /**308 * Ends the element output, if needed.309 *310 * @since 3.0.0
History
Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.