Ticket #40108: 40108.patch
File 40108.patch, 2.6 KB (added by , 8 years ago) |
---|
-
post-template.php
842 842 * Also appended to the current item, which is not linked. Default empty. 843 843 * @type string $next_or_number Indicates whether page numbers should be used. Valid values are number 844 844 * and next. Default is 'number'. 845 * @type string $navwidth Number of links displayed before and after current page. 845 846 * @type string $separator Text between pagination links. Default is ' '. 846 847 * @type string $nextpagelink Link text for the next page link, if available. Default is 'Next Page'. 847 848 * @type string $previouspagelink Link text for the previous page link, if available. Default is 'Previous Page'. … … 865 866 'nextpagelink' => __( 'Next page' ), 866 867 'previouspagelink' => __( 'Previous page' ), 867 868 'pagelink' => '%', 868 'echo' => 1 869 'echo' => 1, 869 870 ); 870 871 871 872 $params = wp_parse_args( $args, $defaults ); … … 912 913 /** This filter is documented in wp-includes/post-template.php */ 913 914 $output .= apply_filters( 'wp_link_pages_link', $link, $prev ); 914 915 } 916 917 // Output number of links equal to $navwidth before current page. 918 if ( 'mixed' == $r['next_or_number'] ) { 919 for ( $i = $page - $navwidth; $i < $page; $i++ ) { 920 if ( $i > 0 ) { 921 $link = _wp_link_page( $i ) . $r['link_before'] . str_replace( '%', $i, $r['pagelink'] ) . $r['link_after'] . '</a>'; 922 $link = apply_filters( 'wp_link_pages_link', $link, $i ); 923 // Use the custom links separator beginning with the second link. 924 $output .= ( 1 !== $i ) ? $r['separator'] : ' '; 925 $output .= $link; 926 } 927 } 928 929 // Output current page within <span> tags for enhanced styling capability. 930 if ( $prev ) { 931 $output .= $r['separator']; 932 } 933 $output .= $r['link_before'] . ('<span>') . str_replace( '%', $i, $r['pagelink'] ) . ('</span>') . $r['link_after']; 934 935 // Output number of links equal to $navwidth after current page. 936 for ( $i = $page + 1; $i <= $numpages; $i++ ) { 937 $link = _wp_link_page( $i ) . $r['link_before'] . str_replace( '%', $i, $r['pagelink'] ) . $r['link_after'] . '</a>'; 938 $link = apply_filters( 'wp_link_pages_link', $link, $i ); 939 $output .= $r['separator'] . $link; 940 } 941 } 942 915 943 $next = $page + 1; 916 944 if ( $next <= $numpages ) { 917 945 if ( $prev ) {