wp_edit_nav_menu_walker filter-hookWP 3.0.0

Filters the Walker class used when adding nav menu items.

Usage

add_filter( 'wp_edit_nav_menu_walker', 'wp_kama_edit_nav_menu_walker_filter', 10, 2 );

/**
 * Function for `wp_edit_nav_menu_walker` filter-hook.
 * 
 * @param string $class   The walker class to use.
 * @param int    $menu_id ID of the menu being rendered.
 *
 * @return string
 */
function wp_kama_edit_nav_menu_walker_filter( $class, $menu_id ){

	// filter...
	return $class;
}
$class(string)
The walker class to use.
Default: 'Walker_Nav_Menu_Edit'
$menu_id(int)
ID of the menu being rendered.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

wp_get_nav_menu_to_edit()
wp_edit_nav_menu_walker
wp_ajax_add_menu_item()
wp_edit_nav_menu_walker
wp-admin/includes/nav-menu.php 1059
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
wp-admin/includes/ajax-actions.php 1561
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );

Where the hook is used in WordPress

Usage not found.