Keep the Nav Menu walker from blowing up the layout on empty-titled items.
fixes #23254. props cais, SergeyBiryukov. git-svn-id: http://core.svn.wordpress.org/trunk@24560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d04bce99e8
commit
92af914abe
|
@ -641,6 +641,9 @@ function wp_setup_nav_menu_item( $menu_item ) {
|
||||||
$menu_item->object = $object->name;
|
$menu_item->object = $object->name;
|
||||||
$menu_item->type_label = $object->labels->singular_name;
|
$menu_item->type_label = $object->labels->singular_name;
|
||||||
|
|
||||||
|
if ( '' === $menu_item->post_title )
|
||||||
|
$menu_item->post_title = sprintf( __( '#%d (no title)' ), $menu_item->ID );
|
||||||
|
|
||||||
$menu_item->title = $menu_item->post_title;
|
$menu_item->title = $menu_item->post_title;
|
||||||
$menu_item->url = get_permalink( $menu_item->ID );
|
$menu_item->url = get_permalink( $menu_item->ID );
|
||||||
$menu_item->target = '';
|
$menu_item->target = '';
|
||||||
|
|
|
@ -1072,6 +1072,9 @@ class Walker_Page extends Walker {
|
||||||
|
|
||||||
$css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
|
$css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
|
||||||
|
|
||||||
|
if ( '' === $page->post_title )
|
||||||
|
$page->post_title = sprintf( __( '#%d (no title)' ), $page->ID );
|
||||||
|
|
||||||
$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>';
|
$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>';
|
||||||
|
|
||||||
if ( !empty($show_date) ) {
|
if ( !empty($show_date) ) {
|
||||||
|
|
Loading…
Reference in New Issue