Rescue those who created menu items before r18733. Trim menu item descriptions. See #16799.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bc3b3aed4d
commit
b225e5b626
|
@ -618,7 +618,9 @@ function wp_setup_nav_menu_item( $menu_item ) {
|
|||
$menu_item->target = empty( $menu_item->target ) ? get_post_meta( $menu_item->ID, '_menu_item_target', true ) : $menu_item->target;
|
||||
|
||||
$menu_item->attr_title = empty( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title;
|
||||
$menu_item->description = empty( $menu_item->description ) ? apply_filters( 'nav_menu_description', $menu_item->post_content ) : $menu_item->description;
|
||||
|
||||
if ( empty( $menu_item->description ) )
|
||||
$menu_item->description = apply_filters( 'nav_menu_description', wp_trim_words( $menu_item->post_content, 200 ) );
|
||||
|
||||
$menu_item->classes = empty( $menu_item->classes ) ? (array) get_post_meta( $menu_item->ID, '_menu_item_classes', true ) : $menu_item->classes;
|
||||
$menu_item->xfn = empty( $menu_item->xfn ) ? get_post_meta( $menu_item->ID, '_menu_item_xfn', true ) : $menu_item->xfn;
|
||||
|
|
Loading…
Reference in New Issue