WordPress.org

Make WordPress Core

Ticket #16998: 16998.2.diff

File 16998.2.diff, 1.7 KB (added by nathanrice, 3 years ago)

Translate $label, use null and is_null for backward compatibility

  • wp-includes/link-template.php

     
    15791579 * @param int $max_page Optional. Max pages. 
    15801580 * @return string|null 
    15811581 */ 
    1582 function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) { 
     1582function get_next_posts_link( $label = null, $max_page = 0 ) { 
    15831583        global $paged, $wp_query; 
    15841584 
    15851585        if ( !$max_page ) 
     
    15891589                $paged = 1; 
    15901590 
    15911591        $nextpage = intval($paged) + 1; 
     1592                 
     1593        $label = is_null( $label ) ? __( 'Next Page »' ) : $label; 
    15921594 
    15931595        if ( !is_single() && ( $nextpage <= $max_page ) ) { 
    15941596                $attr = apply_filters( 'next_posts_link_attributes', '' ); 
     
    16051607 * @param string $label Content for link text. 
    16061608 * @param int $max_page Optional. Max pages. 
    16071609 */ 
    1608 function next_posts_link( $label = 'Next Page &raquo;', $max_page = 0 ) { 
     1610function next_posts_link( $label = null, $max_page = 0 ) { 
    16091611        echo get_next_posts_link( $label, $max_page ); 
    16101612} 
    16111613 
     
    16551657 * @param string $label Optional. Previous page link text. 
    16561658 * @return string|null 
    16571659 */ 
    1658 function get_previous_posts_link( $label = '&laquo; Previous Page' ) { 
     1660function get_previous_posts_link( $label = null ) { 
    16591661        global $paged; 
     1662         
     1663        $label = is_null( $label ) ? __( '&laquo; Previous Page' ) : $label; 
    16601664 
    16611665        if ( !is_single() && $paged > 1 ) { 
    16621666                $attr = apply_filters( 'previous_posts_link_attributes', '' ); 
     
    16721676 * 
    16731677 * @param string $label Optional. Previous page link text. 
    16741678 */ 
    1675 function previous_posts_link( $label = '&laquo; Previous Page' ) { 
     1679function previous_posts_link( $label = null ) { 
    16761680        echo get_previous_posts_link( $label ); 
    16771681} 
    16781682