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 |
---|---|
450 | * @since 3.0.0 |
451 | */ |
452 | function wp_nav_menu_post_type_meta_boxes() { |
453 | $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); |
454 |
|
455 | if ( ! $post_types ) |
456 | return; |
457 |
|
458 | foreach ( $post_types as $post_type ) { |
459 | $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); |
460 | if ( $post_type ) { |
461 | $id = $post_type->name; |
462 | // give pages a higher priority |
463 | $priority = ( 'page' == $post_type->name ? 'core' : 'default' ); |
464 | add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type ); |
465 | } |
466 | } |
467 | } |
468 |
|
Line | Code |
472 | * @since 3.0.0 |
473 | */ |
474 | function wp_nav_menu_taxonomy_meta_boxes() { |
475 | $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); |
476 |
|
477 | if ( !$taxonomies ) |
478 | return; |
479 |
|
480 | foreach ( $taxonomies as $tax ) { |
481 | $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); |
482 | if ( $tax ) { |
483 | $id = $tax->name; |
484 | add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); |
485 | } |
486 | } |
487 | } |
488 |
|
489 | /** |
490 | * Displays a metabox for the nav menu theme locations. |