Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: nav_menu_meta_box_object

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
506            * Filter whether a menu items meta box will be added for the current post type.
507            *
508            * If a falsey value is returned instead of a post type object,
509            * the post type menu items meta box will not be added.
510            *
511            * @since 3.0.0
512            *
513            * @param object $post_type The post type object to be used as a meta box.
514            */
515           $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
516           if ( $post_type ) {
517                $id = $post_type->name;
518                // give pages a higher priority
519                $priority = ( 'page' == $post_type->name ? 'core' : 'default' );
520                add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type );
521           }
522      }
523 }
524
 
Line Code
538            * Filter whether a menu items meta box will be added for the current taxonomy.
539            *
540            * If a falsey value is returned instead of a taxonomy object,
541            * the taxonomy menu items meta box will not be added.
542            *
543            * @since 3.0.0
544            *
545            * @param object $tax The taxonomy object to be used as a meta box.
546            */
547           $tax = apply_filters( 'nav_menu_meta_box_object', $tax );
548           if ( $tax ) {
549                $id = $tax->name;
550                add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );
551           }
552      }
553 }
554
555 /**
556  * Check whether to disable the Menu Locations meta box submit button