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 |
---|---|
646 | * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. |
647 | * |
648 | * @see WP_Query::query() |
649 | * |
650 | * @param object[] $posts The posts for the current post type. Mostly `WP_Post` objects, but |
651 | * can also contain "fake" post objects to represent other menu items. |
652 | * @param array $args An array of `WP_Query` arguments. |
653 | * @param WP_Post_Type $post_type The current post type object for this menu item meta box. |
654 | */ |
655 | $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type ); |
656 |
|
657 | $checkbox_items = walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $posts ), 0, (object) $args ); |
658 |
|
659 | echo $checkbox_items; |
660 | ?> |
661 | </ul> |
662 | <?php if ( ! empty( $page_links ) ) : ?> |
663 | <div class="add-menu-item-pagelinks"> |
664 | <?php echo $page_links; ?> |