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 |
---|---|
507 | * |
508 | * If a falsey value is returned instead of an object, the menu items |
509 | * meta box for the current meta box object will not be added. |
510 | * |
511 | * @since 3.0.0 |
512 | * |
513 | * @param object $meta_box_object The current object to add a menu items |
514 | * meta box for. |
515 | */ |
516 | $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); |
517 | if ( $post_type ) { |
518 | $id = $post_type->name; |
519 | // Give pages a higher priority. |
520 | $priority = ( 'page' == $post_type->name ? 'core' : 'default' ); |
521 | add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type ); |
522 | } |
523 | } |
524 | } |
525 |
|
Line | Code |
530 | */ |
531 | function wp_nav_menu_taxonomy_meta_boxes() { |
532 | $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); |
533 |
|
534 | if ( !$taxonomies ) |
535 | return; |
536 |
|
537 | foreach ( $taxonomies as $tax ) { |
538 | /** This filter is documented in wp-admin/includes/nav-menu.php */ |
539 | $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); |
540 | if ( $tax ) { |
541 | $id = $tax->name; |
542 | add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); |
543 | } |
544 | } |
545 | } |
546 |
|
547 | /** |
548 | * Check whether to disable the Menu Locations meta box submit button |