Make WordPress Core


Ignore:
Timestamp:
03/05/2016 10:56:31 PM (9 years ago)
Author:
jorbin
Message:

Ensure Description is respected in post type archive menu items.

Tested scenarios include: using the default (which is the post type description), Setting a custom description for that individual menu item, and setting a custom description that is blank. Introduced in r35382.

Props Toro_Unit, mayukojpn, extendwings, jorbin.
Fixes #35324. See #16075.

File:
1 edited

Legend:

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

    r36709 r36859  
    768768
    769769                $menu_item->type_label = __( 'Post Type Archive' );
    770                 $menu_item->description = '';
     770                $post_content = wp_trim_words( $menu_item->post_content, 200 );
     771                $post_type_description = '' == $post_content ? $object->description : $post_content;
    771772                $menu_item->url = get_post_type_archive_link( $menu_item->object );
    772773            } elseif ( 'taxonomy' == $menu_item->type ) {
Note: See TracChangeset for help on using the changeset viewer.