#30: nav_menu_meta_box_object

The nav_menu_meta_box_object filter allows you to modify a nav menu meta box object.

It was added in 3.0.

It is evaluated in wp_ajax_menu_get_metabox() in the wp-admin/includes/ajax-actions.php file.

nav_menu_meta_box_object accepts a single argument:

  1. object $item_object The nav menu meta box object, e.g. Page, Post, Category, Tag, etc.


The following example renames the ‘Categories’ and ‘Tags’ accordion sections in the menus screen to ‘Category Archives’ and ‘Tag Archives’ respectively since adding menu links to specific terms in these taxonomies will point to their archives anyway.

View the code example on Gist.

Have a suggested improvement? You can fork the Gist and comment back with the link. If all is agreeable, I’ll merge in your changes. Crowd-sourced documentation FTW!

Leave a Reply

Your email address will not be published. Required fields are marked *