walker_nav_menu_start_el filter-hook . WP 3.0.0
Filters a menu item's starting output.
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.
Usage
add_filter( 'walker_nav_menu_start_el', 'filter_function_name_354', 10, 4 ); function filter_function_name_354( $item_output, $item, $depth, $args ){ // filter... return $item_output; }
- $item_output(string)
- The menu item's starting HTML output.
- $item(WP_Post)
- Menu item data object.
- $depth(int)
- Depth of menu item. Used for padding.
- $args(stdClass)
- An object of wp_nav_menu() arguments.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
walker_nav_menu_start_el
wp-includes/class-walker-nav-menu.php 247
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );