From f64b97c59702b0a55e70ceff42e354f18d2818bd Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 8 Mar 2016 18:25:26 +0000 Subject: [PATCH] Menus: Avoid a notice when outputting a description for an existing archive menu item for a post type that doesn't. Props bradyvercher. See [36859]. Fixes #35324. Built from https://develop.svn.wordpress.org/trunk@36888 git-svn-id: http://core.svn.wordpress.org/trunk@36855 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 7208d9bbf5..70a450e395 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -762,13 +762,15 @@ function wp_setup_nav_menu_item( $menu_item ) { $object = get_post_type_object( $menu_item->object ); if ( $object ) { $menu_item->title = '' == $menu_item->post_title ? $object->labels->archives : $menu_item->post_title; + $post_type_description = $object->description; } else { $menu_item->_invalid = true; + $post_type_description = ''; } $menu_item->type_label = __( 'Post Type Archive' ); $post_content = wp_trim_words( $menu_item->post_content, 200 ); - $post_type_description = '' == $post_content ? $object->description : $post_content; + $post_type_description = '' == $post_content ? $post_type_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 4b763169e6..70f8d78e31 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta2-36887'; +$wp_version = '4.5-beta2-36888'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.