Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: nav_menu_item_title

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
209            * Filters a menu item's title.
210            *
211            * @since 4.4.0
212            *
213            * @param string   $title The menu item's title.
214            * @param WP_Post  $item  The current menu item.
215            * @param stdClass $args  An object of wp_nav_menu() arguments.
216            * @param int      $depth Depth of menu item. Used for padding.
217            */
218           $title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );
219
220           $item_output = $args->before;
221           $item_output .= '<a'. $attributes .'>';
222           $item_output .= $args->link_before . $title . $args->link_after;
223           $item_output .= '</a>';
224           $item_output .= $args->after;
225
226           /**
227            * Filters a menu item's starting output.