WordPress.org

Make WordPress Core

Ticket #1551: 1551-desc.diff

File 1551-desc.diff, 1.4 KB (added by whimboo, 14 years ago)

Patch uses db filed post_excerpt to show a full link title

  • wp-includes/template-functions-post.php

     
    328328                // set the title for the current page
    329329                $page_tree[$page->ID]['title'] = $page->post_title;
    330330                $page_tree[$page->ID]['name'] = $page->post_name;
     331                $page_tree[$page->ID]['desc'] = ($page->post_excerpt != '') ?
     332                                                $page->post_excerpt : $page->post_title;
    331333
    332334                // set the selected date for the current page
    333335                // depending on the query arguments this is either
     
    377379
    378380        foreach($page_tree[$parent]['children'] as $page_id) {
    379381                $cur_page = $page_tree[$page_id];
    380                 $title = $cur_page['title'];
    381 
     382                $title = __($cur_page['title']);
     383                $desc = __($cur_page['desc']);
     384               
    382385                $css_class = 'page_item';
    383386                if( $page_id == $queried_obj->ID) {
    384387                        $css_class .= ' current_page_item';
    385388                }
    386389
    387                 $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page_id) . '" title="' . wp_specialchars($title) . '">' . $title . '</a>';
     390                $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page_id) . '" title="' . wp_specialchars($desc) . '">' . $title . '</a>';
    388391
    389392                if(isset($cur_page['ts'])) {
    390393                        $format = get_settings('date_format');