Ticket #8058: 8058.3.patch

File 8058.3.patch, 2.7 KB (added by Viper007Bond, 3 years ago)
  • wp-includes/link-template.php

     
    12451245} 
    12461246 
    12471247/** 
    1248  * Display link to next comments pages. 
     1248 * Return the link to next comments pages. 
    12491249 * 
    1250  * @since 2.7.0 
     1250 * @since 2.7.1 
    12511251 * 
    12521252 * @param string $label Optional. Label for link text. 
    12531253 * @param int $max_page Optional. Max page. 
     1254 * @return string|null 
    12541255 */ 
    1255 function next_comments_link($label='', $max_page = 0) { 
     1256function get_next_comments_link( $label = '', $max_page = 0 ) { 
    12561257        global $wp_query; 
    12571258 
    12581259        if ( !is_singular() ) 
     
    12771278        if ( empty($label) ) 
    12781279                $label = __('Newer Comments »'); 
    12791280 
    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};)/', '&#038;$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};)/', '&#038;$1', $label) .'</a>'; 
    12831282} 
    12841283 
    12851284/** 
    1286  * Display the previous comments page link. 
     1285 * Display the link to next comments pages. 
    12871286 * 
    12881287 * @since 2.7.0 
    12891288 * 
     1289 * @param string $label Optional. Label for link text. 
     1290 * @param int $max_page Optional. Max page. 
     1291 */ 
     1292function 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 * 
    12901301 * @param string $label Optional. Label for comments link text. 
     1302 * @return string|null 
    12911303 */ 
    1292 function previous_comments_link($label='') { 
    1293  
     1304function get_previous_comments_link( $label = '' ) { 
    12941305        if ( !is_singular() ) 
    12951306                return; 
    12961307 
     
    13071318        if ( empty($label) ) 
    13081319                $label = __('&laquo; Older Comments'); 
    13091320 
    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};)/', '&#038;$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};)/', '&#038;$1', $label) .'</a>'; 
    13131322} 
    13141323 
    13151324/** 
     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 */ 
     1331function previous_comments_link( $label = '' ) { 
     1332        echo get_previous_comments_link( $label ); 
     1333} 
     1334 
     1335/** 
    13161336 * Create pagination links for the comments on the current post. 
    13171337 * 
    13181338 * @see paginate_links()