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
1230      if ( ! empty( $_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) {
1231           $menus_meta_box_object = $items[ $_POST['item-object'] ];
1232           /**
1233            * Filter a nav menu meta box object.
1234            *
1235            * @since 3.0.0
1236            *
1237            * @param object $menus_meta_box_object A nav menu meta box object, such as Page, Post, Category, Tag, etc.
1238            */
1239           $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
1240           ob_start();
1241           call_user_func_array($callback, array(
1242                null,
1243                array(
1244                     'id' => 'add-' . $item->name,
1245                     'title' => $item->labels->name,
1246                     'callback' => $callback,
1247                     'args' => $item,
1248                )