Ticket #4969: 4969.3.diff
| File 4969.3.diff, 3.5 KB (added by , 10 years ago) |
|---|
-
src/wp-includes/general-template.php
1520 1520 * @type string $order Whether to use ascending or descending order. Accepts 'ASC', or 'DESC'. 1521 1521 * Default 'DESC'. 1522 1522 * @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 ''. 1523 1529 * } 1524 1530 * @return string|void String when retrieving. 1525 1531 */ … … 1531 1537 'format' => 'html', 'before' => '', 1532 1538 'after' => '', 'show_post_count' => false, 1533 1539 'echo' => 1, 'order' => 'DESC', 1534 'post_type' => 'post' 1540 'post_type' => 'post', 'title' => '', 1541 'title_before' => '', 'title_after' => '', 1542 'list_before' => '', 'list_after' => '' 1535 1543 ); 1536 1544 1537 1545 $r = wp_parse_args( $args, $defaults ); … … 1599 1607 1600 1608 $output = ''; 1601 1609 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 1602 1618 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 1603 1619 if ( ! $last_changed ) { 1604 1620 $last_changed = microtime(); … … 1730 1746 } 1731 1747 } 1732 1748 } 1749 1750 if ( $r['list_after'] ) { 1751 $output .= $r['list_after']; 1752 } 1753 1733 1754 if ( $r['echo'] ) { 1734 1755 echo $output; 1735 1756 } else { -
src/wp-includes/post-template.php
1124 1124 * @type string $title_li List heading. Passing a null or empty value will result in no heading, and the list 1125 1125 * will not be wrapped with unordered list `<ul>` tags. Default 'Pages'. 1126 1126 * @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> 1127 1129 * } 1128 1130 * @return string|void HTML list of pages. 1129 1131 */ … … 1135 1137 'title_li' => __( 'Pages' ), 'echo' => 1, 1136 1138 'authors' => '', 'sort_column' => 'menu_order, post_title', 1137 1139 'link_before' => '', 'link_after' => '', 'walker' => '', 1140 'before' => '<li class="pagenav">', 'after' => '</li>' 1138 1141 ); 1139 1142 1140 1143 $r = wp_parse_args( $args, $defaults ); … … 1163 1166 1164 1167 if ( ! empty( $pages ) ) { 1165 1168 if ( $r['title_li'] ) { 1166 $output .= '<li class="pagenav">'. $r['title_li'] . '<ul>';1169 $output .= $r['before'] . $r['title_li'] . '<ul>'; 1167 1170 } 1168 1171 global $wp_query; 1169 1172 if ( is_page() || is_attachment() || $wp_query->is_posts_page ) { … … 1178 1181 $output .= walk_page_tree( $pages, $r['depth'], $current_page, $r ); 1179 1182 1180 1183 if ( $r['title_li'] ) { 1181 $output .= '</ul> </li>';1184 $output .= '</ul>' . $r['after']; 1182 1185 } 1183 1186 } 1184 1187