Make WordPress Core

Changeset 14826


Ignore:
Timestamp:
05/23/2010 10:56:51 PM (15 years ago)
Author:
nacin
Message:

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-filters.php

    r14814 r14826  
    8888
    8989// Format titles
    90 foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title' ) as $filter ) {
     90foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) {
    9191    add_filter( $filter, 'wptexturize' );
    9292    add_filter( $filter, 'strip_tags'  );
  • trunk/wp-includes/nav-menu.php

    r14788 r14826  
    585585            $menu_item->target = get_post_meta( $menu_item->ID, '_menu_item_target', true );
    586586
    587             $menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
    588             $menu_item->description = strip_tags( $menu_item->post_content );
     587            $menu_item->attr_title = apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt );
     588            $menu_item->description = apply_filters( 'nav_menu_description', $menu_item->post_content );
    589589
    590590            $menu_item->classes = get_post_meta( $menu_item->ID, '_menu_item_classes', true );
     
    604604            $menu_item->target = '';
    605605
    606             $menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
    607             $menu_item->description = strip_tags( $menu_item->post_content );
     606            $menu_item->attr_title = apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt );
     607            $menu_item->description = apply_filters( 'nav_menu_description', $menu_item->post_content );
    608608            $menu_item->classes = '';
    609609            $menu_item->xfn = '';
     
    625625        $menu_item->target = '';
    626626        $menu_item->attr_title = '';
    627         $menu_item->description = strip_tags( get_term_field( 'description', $menu_item->term_id, $menu_item->taxonomy ) );
     627        $menu_item->description = get_term_field( 'description', $menu_item->term_id, $menu_item->taxonomy );
    628628        $menu_item->classes = '';
    629629        $menu_item->xfn = '';
Note: See TracChangeset for help on using the changeset viewer.