Ticket #24146: 24146.patch
File 24146.patch, 2.5 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/nav-menu.php
1234 1234 foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) { 1235 1235 1236 1236 // Menu item title can't be blank 1237 if ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' == $_POST['menu-item-title'][ $_key ])1237 if ( ! isset( $_POST['menu-item-title'][ $_key ] ) ) 1238 1238 continue; 1239 1239 1240 1240 $args = array(); -
wp-includes/nav-menu.php
336 336 $original_title = $original_object->post_title; 337 337 } 338 338 339 if ( $args['menu-item-title'] == $original_title)340 $args['menu-item-title'] = '';339 if ( $args['menu-item-title'] != '' ) 340 $args['menu-item-title'] = $original_title; 341 341 342 342 // hack to get wp to create a post object when too many properties are empty 343 343 if ( '' == $args['menu-item-title'] && '' == $args['menu-item-description'] ) … … 595 595 596 596 $menu_item->url = get_permalink( $menu_item->object_id ); 597 597 598 $original_object = get_post( $menu_item->object_id );599 $original_title = $original_object->post_title;600 $menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;601 602 598 } elseif ( 'taxonomy' == $menu_item->type ) { 603 599 $object = get_taxonomy( $menu_item->object ); 604 600 if ( $object ) { … … 611 607 $term_url = get_term_link( (int) $menu_item->object_id, $menu_item->object ); 612 608 $menu_item->url = !is_wp_error( $term_url ) ? $term_url : ''; 613 609 614 $original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' );615 if ( is_wp_error( $original_title ) )616 $original_title = false;617 $menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;618 619 610 } else { 620 611 $menu_item->type_label = __('Custom'); 621 $menu_item->title = $menu_item->post_title;622 612 $menu_item->url = empty( $menu_item->url ) ? get_post_meta( $menu_item->ID, '_menu_item_url', true ) : $menu_item->url; 623 613 } 624 614 615 $menu_item->title = $menu_item->post_title; 616 625 617 $menu_item->target = empty( $menu_item->target ) ? get_post_meta( $menu_item->ID, '_menu_item_target', true ) : $menu_item->target; 626 618 627 619 $menu_item->attr_title = empty( $menu_item->attr_title ) ? apply_filters( 'nav_menu_attr_title', $menu_item->post_excerpt ) : $menu_item->attr_title;