From d71a0600a6b20cb0b2bb5967e02334638b3ab030 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Sat, 5 Mar 2016 22:57:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@36859 git-svn-id: http://core.svn.wordpress.org/trunk@36826 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 0c81711768..7208d9bbf5 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -767,7 +767,8 @@ function wp_setup_nav_menu_item( $menu_item ) { } $menu_item->type_label = __( 'Post Type Archive' ); - $menu_item->description = ''; + $post_content = wp_trim_words( $menu_item->post_content, 200 ); + $post_type_description = '' == $post_content ? $object->description : $post_content; $menu_item->url = get_post_type_archive_link( $menu_item->object ); } elseif ( 'taxonomy' == $menu_item->type ) { $object = get_taxonomy( $menu_item->object ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 4e04768d1c..789b669cf5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta2-36858'; +$wp_version = '4.5-beta2-36859'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.