Set min-height for menu item title. Add a fallback for empty-titled items.

props philiparthurmoore.
fixes #30283.

git-svn-id: https://develop.svn.wordpress.org/trunk@30500 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-11-21 05:56:23 +00:00
parent 1eca0cb442
commit 5f1c87f271
2 changed files with 6 additions and 0 deletions

View File

@ -471,6 +471,7 @@ ul.add-menu-item-tabs li {
position: relative; position: relative;
padding: 10px 15px; padding: 10px 15px;
height: auto; height: auto;
min-height: 20px;
width: 382px; width: 382px;
line-height: 30px; line-height: 30px;
overflow: hidden; overflow: hidden;

View File

@ -661,6 +661,11 @@ function wp_setup_nav_menu_item( $menu_item ) {
$original_object = get_post( $menu_item->object_id ); $original_object = get_post( $menu_item->object_id );
$original_title = $original_object->post_title; $original_title = $original_object->post_title;
if ( '' === $original_title ) {
$original_title = sprintf( __( '#%d (no title)' ), $original_object->ID );
}
$menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title; $menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
} elseif ( 'taxonomy' == $menu_item->type ) { } elseif ( 'taxonomy' == $menu_item->type ) {