Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: nav_menu_attr_title

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
773                $menu_item->target = ! isset( $menu_item->target ) ? get_post_meta( $menu_item->ID, '_menu_item_target', true ) : $menu_item->target;
774
775                /**
776                 * Filters a navigation menu item's title attribute.
777                 *
778                 * @since 3.0.0
779                 *
780                 * @param string $item_title The menu item title attribute.
781                 */
782                $menu_item->attr_title = ! isset( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title;
783
784                if ( ! isset( $menu_item->description ) ) {
785                     /**
786                      * Filters a navigation menu item's description.
787                      *
788                      * @since 3.0.0
789                      *
790                      * @param string $description The menu item description.
791                      */
 
Line Code
808                     /* translators: %d: ID of a post */
809                     $menu_item->post_title = sprintf( __( '#%d (no title)' ), $menu_item->ID );
810                }
811
812                $menu_item->title = $menu_item->post_title;
813                $menu_item->url = get_permalink( $menu_item->ID );
814                $menu_item->target = '';
815
816                /** This filter is documented in wp-includes/nav-menu.php */
817                $menu_item->attr_title = apply_filters( 'nav_menu_attr_title', '' );
818
819                /** This filter is documented in wp-includes/nav-menu.php */
820                $menu_item->description = apply_filters( 'nav_menu_description', '' );
821                $menu_item->classes = array();
822                $menu_item->xfn = '';
823           }
824      } elseif ( isset( $menu_item->taxonomy ) ) {
825           $menu_item->ID = $menu_item->term_id;
826           $menu_item->db_id = 0;