Ticket #8058: 8058.3.patch
| File 8058.3.patch, 2.7 KB (added by Viper007Bond, 3 years ago) |
|---|
-
wp-includes/link-template.php
1245 1245 } 1246 1246 1247 1247 /** 1248 * Displaylink to next comments pages.1248 * Return the link to next comments pages. 1249 1249 * 1250 * @since 2.7. 01250 * @since 2.7.1 1251 1251 * 1252 1252 * @param string $label Optional. Label for link text. 1253 1253 * @param int $max_page Optional. Max page. 1254 * @return string|null 1254 1255 */ 1255 function next_comments_link($label='', $max_page = 0) {1256 function get_next_comments_link( $label = '', $max_page = 0 ) { 1256 1257 global $wp_query; 1257 1258 1258 1259 if ( !is_singular() ) … … 1277 1278 if ( empty($label) ) 1278 1279 $label = __('Newer Comments »'); 1279 1280 1280 echo '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ); 1281 $attr = apply_filters( 'next_comments_link_attributes', '' ); 1282 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1281 return '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1283 1282 } 1284 1283 1285 1284 /** 1286 * Display the previous comments page link.1285 * Display the link to next comments pages. 1287 1286 * 1288 1287 * @since 2.7.0 1289 1288 * 1289 * @param string $label Optional. Label for link text. 1290 * @param int $max_page Optional. Max page. 1291 */ 1292 function next_comments_link( $label = '', $max_page = 0 ) { 1293 echo get_next_comments_link( $label, $max_page ); 1294 } 1295 1296 /** 1297 * Return the previous comments page link. 1298 * 1299 * @since 2.7.1 1300 * 1290 1301 * @param string $label Optional. Label for comments link text. 1302 * @return string|null 1291 1303 */ 1292 function previous_comments_link($label='') { 1293 1304 function get_previous_comments_link( $label = '' ) { 1294 1305 if ( !is_singular() ) 1295 1306 return; 1296 1307 … … 1307 1318 if ( empty($label) ) 1308 1319 $label = __('« Older Comments'); 1309 1320 1310 echo '<a href="' . clean_url(get_comments_pagenum_link($prevpage)); 1311 $attr = apply_filters( 'previous_comments_link_attributes', '' ); 1312 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1321 return '<a href="' . clean_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1313 1322 } 1314 1323 1315 1324 /** 1325 * Display the previous comments page link. 1326 * 1327 * @since 2.7.0 1328 * 1329 * @param string $label Optional. Label for comments link text. 1330 */ 1331 function previous_comments_link( $label = '' ) { 1332 echo get_previous_comments_link( $label ); 1333 } 1334 1335 /** 1316 1336 * Create pagination links for the comments on the current post. 1317 1337 * 1318 1338 * @see paginate_links()
