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