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