Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: nav_menu_items_{$post_type_name}

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
516                      *
517                      * @since 3.2.0
518                      *
519                      * @see WP_Query::query()
520                      *
521                      * @param array  $posts     The posts for the current post type.
522                      * @param array  $args      An array of WP_Query arguments.
523                      * @param object $post_type The current post type object for this menu item meta box.
524                      */
525                     $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type );
526                     $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
527
528                     if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
529                          $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
530
531                     }
532
533                     echo $checkbox_items;
534                     ?>