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
1131           $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') );
1132           $result = '<div id="menu-instructions" class="post-body-plain';
1133           $result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">';
1134           $result .= '<p>' . __( 'Add menu items from the column on the left.' ) . '</p>';
1135           $result .= '</div>';
1136
1137           if( empty($menu_items) )
1138                return $result . ' <ul class="menu" id="menu-to-edit"> </ul>';
1139
1140           $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
1141
1142           if ( class_exists( $walker_class_name ) )
1143                $walker = new $walker_class_name;
1144           else
1145                return new WP_Error( 'menu_walker_not_exist', sprintf( __('The Walker class named <strong>%s</strong> does not exist.'), $walker_class_name ) );
1146
1147           $some_pending_menu_items = $some_invalid_menu_items = false;
1148           foreach( (array) $menu_items as $menu_item ) {
1149                if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status )