diff --git src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
index 8bffb0e..c338c88 100644
|
|
class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { |
273 | 273 | * @return string The original title. |
274 | 274 | */ |
275 | 275 | protected function get_original_title( $item ) { |
276 | | if ( empty( $item->object_id ) ) { |
277 | | return ''; |
278 | | } |
279 | 276 | $original_title = ''; |
280 | | if ( 'post_type' === $item->type ) { |
| 277 | if ( 'post_type' === $item->type && ! empty( $item->object_id ) ) { |
281 | 278 | $original_object = get_post( $item->object_id ); |
282 | 279 | if ( $original_object ) { |
283 | 280 | /** This filter is documented in wp-includes/post-template.php */ |
… |
… |
class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { |
288 | 285 | $original_title = sprintf( __( '#%d (no title)' ), $original_object->ID ); |
289 | 286 | } |
290 | 287 | } |
291 | | } elseif ( 'taxonomy' === $item->type ) { |
| 288 | } elseif ( 'taxonomy' === $item->type && ! empty( $item->object_id ) ) { |
292 | 289 | $original_term_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' ); |
293 | 290 | if ( ! is_wp_error( $original_term_title ) ) { |
294 | 291 | $original_title = $original_term_title; |
295 | 292 | } |
| 293 | } elseif ( 'post_type_archive' === $item->type ) { |
| 294 | $original_object = get_post_type_object( $item->object ); |
| 295 | if ( $original_object ) { |
| 296 | $original_title = $original_object->labels->archives; |
| 297 | } |
296 | 298 | } |
297 | 299 | $original_title = html_entity_decode( $original_title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
298 | 300 | return $original_title; |