wp_nav_menu filter-hookWP 3.0.0

Filters the HTML content for navigation menus.

Usage

add_filter( 'wp_nav_menu', 'wp_kama_nav_menu_filter', 10, 2 );

/**
 * Function for `wp_nav_menu` filter-hook.
 * 
 * @param string   $nav_menu The HTML content for the navigation menu.
 * @param stdClass $args     An object containing wp_nav_menu() arguments.
 *
 * @return string
 */
function wp_kama_nav_menu_filter( $nav_menu, $args ){

	// filter...
	return $nav_menu;
}
$nav_menu(string)
The HTML content for the navigation menu.
$args(stdClass)
An object containing wp_nav_menu() arguments.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

wp_nav_menu()
wp_nav_menu
wp-includes/nav-menu-template.php 294
$nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args );

Where the hook is used in WordPress

wp-includes/class-wp-customize-nav-menus.php 1324
add_filter( 'wp_nav_menu', array( $this, 'filter_wp_nav_menu' ), 10, 2 );