Make WordPress Core

Ticket #4969: 4969.3.diff

File 4969.3.diff, 3.5 KB (added by igmoweb, 10 years ago)

Patch reviewed

  • src/wp-includes/general-template.php

     
    15201520 *     @type string     $order           Whether to use ascending or descending order. Accepts 'ASC', or 'DESC'.
    15211521 *                                       Default 'DESC'.
    15221522 *     @type string     $post_type       Post type. Default 'post'.
     1523 *     @type string     $title           List heading. Passing a null or empty value will result in no heading, and the list
     1524 *                                       will not be wrapped and $title_before and $title_after become useless. Default ''.
     1525 *     @type string     $title_before    Text or HTML to precede the title. Default ''.
     1526 *     @type string     $title_after     Text or HTML to follow the title. Default ''.
     1527 *     @type string     $list_before     Text or HTML to precede the list. Default ''.
     1528 *     @type string     $list_after      Text or HTML to follow the list. Default ''.
    15231529 * }
    15241530 * @return string|void String when retrieving.
    15251531 */
     
    15311537                'format' => 'html', 'before' => '',
    15321538                'after' => '', 'show_post_count' => false,
    15331539                'echo' => 1, 'order' => 'DESC',
    1534                 'post_type' => 'post'
     1540                'post_type' => 'post', 'title' => '',
     1541                'title_before' => '', 'title_after' => '',
     1542                'list_before' => '', 'list_after' => ''
    15351543        );
    15361544
    15371545        $r = wp_parse_args( $args, $defaults );
     
    15991607
    16001608        $output = '';
    16011609
     1610        if ( '' != $r['title'] ) {
     1611                $output .= $r['title_before']. $r['title']. $r['title_after'];
     1612        }
     1613
     1614        if ( $r['list_before'] ) {
     1615                $output .= $r['list_before'];
     1616        }
     1617
    16021618        $last_changed = wp_cache_get( 'last_changed', 'posts' );
    16031619        if ( ! $last_changed ) {
    16041620                $last_changed = microtime();
     
    17301746                        }
    17311747                }
    17321748        }
     1749
     1750        if ( $r['list_after'] ) {
     1751                $output .= $r['list_after'];
     1752        }
     1753
    17331754        if ( $r['echo'] ) {
    17341755                echo $output;
    17351756        } else {
  • src/wp-includes/post-template.php

     
    11241124 *     @type string $title_li     List heading. Passing a null or empty value will result in no heading, and the list
    11251125 *                                will not be wrapped with unordered list `<ul>` tags. Default 'Pages'.
    11261126 *     @type Walker $walker       Walker instance to use for listing pages. Default empty (Walker_Page).
     1127 *     @type string $before       Text or HTML to precede the list of pages. Default <li class="pagenav">
     1128 *     @type string $after        Text or HTML to follow the list of pages. Default </li>
    11271129 * }
    11281130 * @return string|void HTML list of pages.
    11291131 */
     
    11351137                'title_li' => __( 'Pages' ), 'echo' => 1,
    11361138                'authors' => '', 'sort_column' => 'menu_order, post_title',
    11371139                'link_before' => '', 'link_after' => '', 'walker' => '',
     1140                'before' => '<li class="pagenav">', 'after' => '</li>'
    11381141        );
    11391142
    11401143        $r = wp_parse_args( $args, $defaults );
     
    11631166
    11641167        if ( ! empty( $pages ) ) {
    11651168                if ( $r['title_li'] ) {
    1166                         $output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
     1169                        $output .= $r['before'] . $r['title_li'] . '<ul>';
    11671170                }
    11681171                global $wp_query;
    11691172                if ( is_page() || is_attachment() || $wp_query->is_posts_page ) {
     
    11781181                $output .= walk_page_tree( $pages, $r['depth'], $current_page, $r );
    11791182
    11801183                if ( $r['title_li'] ) {
    1181                         $output .= '</ul></li>';
     1184                        $output .= '</ul>' . $r['after'];
    11821185                }
    11831186        }
    11841187