Replacing WordPress menu functionality with a plugin

Err… There’s plenty of filters on the menu system.

The ‘wp_nav_menu’ filter is called on the output of the wp_nav_menu() function call. So if you need to modify the menu output, you can use that.

The ‘wp_nav_menu_items’ filter is called on the resulting array of items (basically all the LI items).

If you need to modify the arguments passed into wp_nav_menu, such as to dynamically add your own walker, you can use the ‘wp_nav_menu_args’ filter for that.

There’s a lot more filters which are more specific and can probably be used to change things in more subtle ways. These are sorta the main club-like filters that change the whole thing.

Leave a Comment