Properly format menu item title attributes and descriptions. props ryan, fixes #12864.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-23 22:56:51 +00:00
parent 6da2d3102d
commit 35a9bc1670
2 changed files with 6 additions and 6 deletions

View File

@ -87,7 +87,7 @@ foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description',
}
// Format titles
foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title' ) as $filter ) {
foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) {
add_filter( $filter, 'wptexturize' );
add_filter( $filter, 'strip_tags' );
}

View File

@ -584,8 +584,8 @@ function wp_setup_nav_menu_item( $menu_item ) {
$menu_item->target = get_post_meta( $menu_item->ID, '_menu_item_target', true );
$menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
$menu_item->description = strip_tags( $menu_item->post_content );
$menu_item->attr_title = apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt );
$menu_item->description = apply_filters( 'nav_menu_description', $menu_item->post_content );
$menu_item->classes = get_post_meta( $menu_item->ID, '_menu_item_classes', true );
$menu_item->xfn = get_post_meta( $menu_item->ID, '_menu_item_xfn', true );
@ -603,8 +603,8 @@ function wp_setup_nav_menu_item( $menu_item ) {
$menu_item->url = get_permalink( $menu_item->ID );
$menu_item->target = '';
$menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
$menu_item->description = strip_tags( $menu_item->post_content );
$menu_item->attr_title = apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt );
$menu_item->description = apply_filters( 'nav_menu_description', $menu_item->post_content );
$menu_item->classes = '';
$menu_item->xfn = '';
}
@ -624,7 +624,7 @@ function wp_setup_nav_menu_item( $menu_item ) {
$menu_item->url = get_term_link( $menu_item, $menu_item->taxonomy );
$menu_item->target = '';
$menu_item->attr_title = '';
$menu_item->description = strip_tags( get_term_field( 'description', $menu_item->term_id, $menu_item->taxonomy ) );
$menu_item->description = get_term_field( 'description', $menu_item->term_id, $menu_item->taxonomy );
$menu_item->classes = '';
$menu_item->xfn = '';