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 |
|---|---|
| 798 | $menu_item->target = ! isset( $menu_item->target ) ? get_post_meta( $menu_item->ID, '_menu_item_target', true ) : $menu_item->target; |
| 799 | |
| 800 | /** |
| 801 | * Filter a navigation menu item's title attribute. |
| 802 | * |
| 803 | * @since 3.0.0 |
| 804 | * |
| 805 | * @param string $item_title The menu item title attribute. |
| 806 | */ |
| 807 | $menu_item->attr_title = ! isset( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title; |
| 808 | |
| 809 | if ( ! isset( $menu_item->description ) ) { |
| 810 | /** |
| 811 | * Filter a navigation menu item's description. |
| 812 | * |
| 813 | * @since 3.0.0 |
| 814 | * |
| 815 | * @param string $description The menu item description. |
| 816 | */ |
| Line | Code |
| 833 | /* translators: %d: ID of a post */ |
| 834 | $menu_item->post_title = sprintf( __( '#%d (no title)' ), $menu_item->ID ); |
| 835 | } |
| 836 | |
| 837 | $menu_item->title = $menu_item->post_title; |
| 838 | $menu_item->url = get_permalink( $menu_item->ID ); |
| 839 | $menu_item->target = ''; |
| 840 | |
| 841 | /** This filter is documented in wp-includes/nav-menu.php */ |
| 842 | $menu_item->attr_title = apply_filters( 'nav_menu_attr_title', '' ); |
| 843 | |
| 844 | /** This filter is documented in wp-includes/nav-menu.php */ |
| 845 | $menu_item->description = apply_filters( 'nav_menu_description', '' ); |
| 846 | $menu_item->classes = array(); |
| 847 | $menu_item->xfn = ''; |
| 848 | } |
| 849 | } elseif ( isset( $menu_item->taxonomy ) ) { |
| 850 | $menu_item->ID = $menu_item->term_id; |
| 851 | $menu_item->db_id = 0; |