Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: nav_menu_meta_box_object

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

This hook occurs 2 times in this file.

Line Code
436  * @since 3.0.0
437  */
438 function wp_nav_menu_post_type_meta_boxes() {
439      $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' );
440
441      if ( ! $post_types )
442           return;
443
444      foreach ( $post_types as $post_type ) {
445           $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
446           if ( $post_type ) {
447                $id = $post_type->name;
448                add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );
449           }
450      }
451 }
452
453 /**
454  * Creates metaboxes for any taxonomy menu item.
 
Line Code
456  * @since 3.0.0
457  */
458 function wp_nav_menu_taxonomy_meta_boxes() {
459      $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' );
460
461      if ( !$taxonomies )
462           return;
463
464      foreach ( $taxonomies as $tax ) {
465           $tax = apply_filters( 'nav_menu_meta_box_object', $tax );
466           if ( $tax ) {
467                $id = $tax->name;
468                add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );
469           }
470      }
471 }
472
473 /**
474  * Displays a metabox for the nav menu theme locations.