Make WordPress Core

Changeset 24560


Ignore:
Timestamp:
07/05/2013 03:41:46 PM (11 years ago)
Author:
markjaquith
Message:

Keep the Nav Menu walker from blowing up the layout on empty-titled items.

fixes #23254. props cais, SergeyBiryukov.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/nav-menu.php

    r24235 r24560  
    642642            $menu_item->type_label = $object->labels->singular_name;
    643643
     644            if ( '' === $menu_item->post_title )
     645                $menu_item->post_title = sprintf( __( '#%d (no title)' ), $menu_item->ID );
     646
    644647            $menu_item->title = $menu_item->post_title;
    645648            $menu_item->url = get_permalink( $menu_item->ID );
  • trunk/wp-includes/post-template.php

    r24557 r24560  
    10731073        $css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
    10741074
     1075        if ( '' === $page->post_title )
     1076            $page->post_title = sprintf( __( '#%d (no title)' ), $page->ID );
     1077
    10751078        $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
    10761079
Note: See TracChangeset for help on using the changeset viewer.