Changeset 9296 for trunk/wp-includes/link-template.php
- Timestamp:
- 10/23/2008 04:08:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r9274 r9296 1136 1136 * @return string 1137 1137 */ 1138 function get_comments_pagenum_link( $pagenum = 1) {1138 function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) { 1139 1139 global $wp_rewrite; 1140 1140 … … 1152 1152 $base = trailingslashit( get_bloginfo( 'home' ) ); 1153 1153 1154 if ( $pagenum > 1 ) { 1154 $result = $base . $request; 1155 1156 if ( 'newest' == get_option('default_comments_page') ) { 1157 if ( $pagenum != $max_page ) 1158 $result = add_query_arg( 'cpage', $pagenum, $base . $request ); 1159 } elseif ( $pagenum > 1 ) 1155 1160 $result = add_query_arg( 'cpage', $pagenum, $base . $request ); 1156 } else {1157 $result = $base . $request;1158 }1159 1161 1160 1162 $result .= '#comments'; … … 1195 1197 $label = __('» Newer Comments'); 1196 1198 1197 echo '<a href="' . clean_url( get_comments_pagenum_link($nextpage));1199 echo '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ); 1198 1200 $attr = apply_filters( 'next_comments_link_attributes', '' ); 1199 1201 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>';
Note: See TracChangeset
for help on using the changeset viewer.