diff --git src/wp-admin/includes/nav-menu.php src/wp-admin/includes/nav-menu.php
index b4ba257..34f16a0 100644
|
|
function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selecte |
1181 | 1181 | if ( ! empty( $_POST['menu-item-db-id'] ) ) { |
1182 | 1182 | foreach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) { |
1183 | 1183 | |
1184 | | // Menu item title can't be blank. |
1185 | | if ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' === $_POST['menu-item-title'][ $_key ] ) { |
1186 | | continue; |
1187 | | } |
1188 | | |
1189 | 1184 | $args = array(); |
1190 | 1185 | foreach ( $post_fields as $field ) { |
1191 | 1186 | $args[ $field ] = isset( $_POST[ $field ][ $_key ] ) ? $_POST[ $field ][ $_key ] : ''; |
diff --git src/wp-includes/nav-menu.php src/wp-includes/nav-menu.php
index e786d78..afa15ec 100644
|
|
function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item |
475 | 475 | |
476 | 476 | $args['menu-item-url'] = ''; |
477 | 477 | |
478 | | $original_title = ''; |
479 | 478 | if ( 'taxonomy' === $args['menu-item-type'] ) { |
480 | 479 | $original_parent = get_term_field( 'parent', $args['menu-item-object-id'], $args['menu-item-object'], 'raw' ); |
481 | | $original_title = get_term_field( 'name', $args['menu-item-object-id'], $args['menu-item-object'], 'raw' ); |
482 | 480 | } elseif ( 'post_type' === $args['menu-item-type'] ) { |
483 | | |
484 | 481 | $original_object = get_post( $args['menu-item-object-id'] ); |
485 | 482 | $original_parent = (int) $original_object->post_parent; |
486 | | $original_title = $original_object->post_title; |
487 | 483 | } elseif ( 'post_type_archive' === $args['menu-item-type'] ) { |
488 | 484 | $original_object = get_post_type_object( $args['menu-item-object'] ); |
489 | | if ( $original_object ) { |
490 | | $original_title = $original_object->labels->archives; |
491 | | } |
492 | | } |
493 | | |
494 | | if ( $args['menu-item-title'] == $original_title ) { |
495 | | $args['menu-item-title'] = ''; |
496 | 485 | } |
497 | 486 | |
498 | 487 | // Hack to get wp to create a post object when too many properties are empty. |
… |
… |
function wp_setup_nav_menu_item( $menu_item ) { |
838 | 827 | |
839 | 828 | if ( $original_object ) { |
840 | 829 | $menu_item->url = get_permalink( $original_object->ID ); |
841 | | /** This filter is documented in wp-includes/post-template.php */ |
842 | | $original_title = apply_filters( 'the_title', $original_object->post_title, $original_object->ID ); |
843 | 830 | } else { |
844 | 831 | $menu_item->url = ''; |
845 | | $original_title = ''; |
846 | 832 | $menu_item->_invalid = true; |
847 | 833 | } |
848 | 834 | |
849 | | if ( '' === $original_title ) { |
850 | | /* translators: %d: ID of a post. */ |
851 | | $original_title = sprintf( __( '#%d (no title)' ), $menu_item->object_id ); |
852 | | } |
853 | | |
854 | | $menu_item->title = ( '' === $menu_item->post_title ) ? $original_title : $menu_item->post_title; |
| 835 | $menu_item->title = $menu_item->post_title; |
855 | 836 | |
856 | 837 | } elseif ( 'post_type_archive' === $menu_item->type ) { |
857 | 838 | $object = get_post_type_object( $menu_item->object ); |