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.
This hook occurs 2 times in this file.
Line | Code |
---|---|
435 | * @since 3.0.0 |
436 | */ |
437 | function wp_nav_menu_post_type_meta_boxes() { |
438 | $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); |
439 |
|
440 | if ( ! $post_types ) |
441 | return; |
442 |
|
443 | foreach ( $post_types as $post_type ) { |
444 | $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); |
445 | if ( $post_type ) { |
446 | $id = $post_type->name; |
447 | add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type ); |
448 | } |
449 | } |
450 | } |
451 |
|
452 | /** |
453 | * Creates metaboxes for any taxonomy menu item. |
Line | Code |
455 | * @since 3.0.0 |
456 | */ |
457 | function wp_nav_menu_taxonomy_meta_boxes() { |
458 | $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); |
459 |
|
460 | if ( !$taxonomies ) |
461 | return; |
462 |
|
463 | foreach ( $taxonomies as $tax ) { |
464 | $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); |
465 | if ( $tax ) { |
466 | $id = $tax->name; |
467 | add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); |
468 | } |
469 | } |
470 | } |
471 |
|
472 | /** |
473 | * Displays a metabox for the nav menu theme locations. |