WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
1086 | $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') ); |
1087 | $result = '<div id="menu-instructions" class="post-body-plain'; |
1088 | $result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">'; |
1089 | $result .= '<p>' . __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.') . '</p>'; |
1090 | $result .= '</div>'; |
1091 |
|
1092 | if( empty($menu_items) ) |
1093 | return $result . ' <ul class="menu" id="menu-to-edit"> </ul>'; |
1094 |
|
1095 | $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id ); |
1096 |
|
1097 | if ( class_exists( $walker_class_name ) ) |
1098 | $walker = new $walker_class_name; |
1099 | else |
1100 | return new WP_Error( 'menu_walker_not_exist', sprintf( __('The Walker class named <strong>%s</strong> does not exist.'), $walker_class_name ) ); |
1101 |
|
1102 | $some_pending_menu_items = $some_invalid_menu_items = false; |
1103 | foreach( (array) $menu_items as $menu_item ) { |
1104 | if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status ) |