Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_edit_nav_menu_walker

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
1064           $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') );
1065           $result = '<div id="menu-instructions" class="post-body-plain';
1066           $result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">';
1067           $result .= '<p>' . __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.') . '</p>';
1068           $result .= '</div>';
1069
1070           if( empty($menu_items) )
1071                return $result . ' <ul class="menu" id="menu-to-edit"> </ul>';
1072
1073           $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
1074
1075           if ( class_exists( $walker_class_name ) )
1076                $walker = new $walker_class_name;
1077           else
1078                return new WP_Error( 'menu_walker_not_exist', sprintf( __('The Walker class named <strong>%s</strong> does not exist.'), $walker_class_name ) );
1079
1080           $some_pending_menu_items = false;
1081           foreach( (array) $menu_items as $menu_item ) {
1082                if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status )