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 |
---|---|
561 |
|
562 | } else { |
563 | $menu_item->type_label = __('Custom'); |
564 | $menu_item->title = $menu_item->post_title; |
565 | $menu_item->url = empty( $menu_item->url ) ? get_post_meta( $menu_item->ID, '_menu_item_url', true ) : $menu_item->url; |
566 | } |
567 |
|
568 | $menu_item->target = empty( $menu_item->target ) ? get_post_meta( $menu_item->ID, '_menu_item_target', true ) : $menu_item->target; |
569 |
|
570 | $menu_item->attr_title = empty( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title; |
571 | $menu_item->description = empty( $menu_item->description ) ? apply_filters( 'nav_menu_description', $menu_item->post_content ) : $menu_item->description; |
572 |
|
573 | $menu_item->classes = empty( $menu_item->classes ) ? (array) get_post_meta( $menu_item->ID, '_menu_item_classes', true ) : $menu_item->classes; |
574 | $menu_item->xfn = empty( $menu_item->xfn ) ? get_post_meta( $menu_item->ID, '_menu_item_xfn', true ) : $menu_item->xfn; |
575 | } else { |
576 | $menu_item->db_id = 0; |
577 | $menu_item->menu_item_parent = 0; |
578 | $menu_item->object_id = (int) $menu_item->ID; |
579 | $menu_item->type = 'post_type'; |
580 |
|
581 | $object = get_post_type_object( $menu_item->post_type ); |
582 | $menu_item->object = $object->name; |
583 | $menu_item->type_label = $object->labels->singular_name; |
584 |
|
585 | $menu_item->title = $menu_item->post_title; |
586 | $menu_item->url = get_permalink( $menu_item->ID ); |
587 | $menu_item->target = ''; |
588 |
|
589 | $menu_item->attr_title = apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ); |
590 | $menu_item->description = apply_filters( 'nav_menu_description', $menu_item->post_content ); |
591 | $menu_item->classes = array(); |
592 | $menu_item->xfn = ''; |
593 | } |
594 | } elseif ( isset( $menu_item->taxonomy ) ) { |
595 | $menu_item->ID = $menu_item->term_id; |
596 | $menu_item->db_id = 0; |
597 | $menu_item->menu_item_parent = 0; |
598 | $menu_item->object_id = (int) $menu_item->term_id; |