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 |
---|---|
422 | * @since 3.0.0 |
423 | */ |
424 | function wp_nav_menu_post_type_meta_boxes() { |
425 | $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); |
426 |
|
427 | if ( ! $post_types ) |
428 | return; |
429 |
|
430 | foreach ( $post_types as $post_type ) { |
431 | $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); |
432 | if ( $post_type ) { |
433 | $id = $post_type->name; |
434 | add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type ); |
435 | } |
436 | } |
437 | } |
438 |
|
439 | /** |
440 | * Creates metaboxes for any taxonomy menu item. |
Line | Code |
442 | * @since 3.0.0 |
443 | */ |
444 | function wp_nav_menu_taxonomy_meta_boxes() { |
445 | $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); |
446 |
|
447 | if ( !$taxonomies ) |
448 | return; |
449 |
|
450 | foreach ( $taxonomies as $tax ) { |
451 | $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); |
452 | if ( $tax ) { |
453 | $id = $tax->name; |
454 | add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); |
455 | } |
456 | } |
457 | } |
458 |
|
459 | /** |
460 | * Displays a metabox for the nav menu theme locations. |