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

Line Code
1052           $callback = 'wp_nav_menu_item_post_type_meta_box';
1053           $items = (array) get_post_types( array( 'show_in_nav_menus' => true ), 'object' );
1054      } elseif ( isset( $_POST['item-type'] ) && 'taxonomy' == $_POST['item-type'] ) {
1055           $type = 'taxonomy';
1056           $callback = 'wp_nav_menu_item_taxonomy_meta_box';
1057           $items = (array) get_taxonomies( array( 'show_ui' => true ), 'object' );
1058      }
1059
1060      if ( ! empty( $_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) {
1061           $item = apply_filters( 'nav_menu_meta_box_object', $items[ $_POST['item-object'] ] );
1062           ob_start();
1063           call_user_func_array($callback, array(
1064                null,
1065                array(
1066                     'id' => 'add-' . $item->name,
1067                     'title' => $item->labels->name,
1068                     'callback' => $callback,
1069                     'args' => $item,
1070                )