Make WordPress Core

Changeset 18734


Ignore:
Timestamp:
09/20/2011 10:57:47 PM (13 years ago)
Author:
duck_
Message:

Rescue those who created menu items before r18733. Trim menu item descriptions. See #16799.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/nav-menu.php

    r18733 r18734  
    619619
    620620            $menu_item->attr_title = empty( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title;
    621             $menu_item->description = empty( $menu_item->description ) ? apply_filters( 'nav_menu_description', $menu_item->post_content ) : $menu_item->description;
     621
     622            if ( empty( $menu_item->description ) )
     623                $menu_item->description = apply_filters( 'nav_menu_description',  wp_trim_words( $menu_item->post_content, 200 ) );
    622624
    623625            $menu_item->classes = empty( $menu_item->classes ) ? (array) get_post_meta( $menu_item->ID, '_menu_item_classes', true ) : $menu_item->classes;
Note: See TracChangeset for help on using the changeset viewer.