WordPress.org

Make WordPress Core

Ticket #17339: 17339.diff

File 17339.diff, 900 bytes (added by scribu, 7 years ago)
  • wp-includes/link-template.php

     
    15801580 * @return string|null
    15811581 */
    15821582function get_next_posts_link( $label = null, $max_page = 0 ) {
    1583         global $paged, $wp_query;
    1584 
     1583        global $wp_query;
     1584       
    15851585        if ( !$max_page )
    15861586                $max_page = $wp_query->max_num_pages;
    15871587
    1588         if ( !$paged )
    1589                 $paged = 1;
     1588        $paged = max( $wp_query->get( 'paged' ), 1 );
    15901589
    1591         $nextpage = intval($paged) + 1;
    1592                
     1590        $nextpage = intval( $paged ) + 1;
     1591
    15931592        if ( null === $label )
    15941593                $label = __( 'Next Page »' );
    15951594
     
    16591658 * @return string|null
    16601659 */
    16611660function get_previous_posts_link( $label = null ) {
    1662         global $paged;
     1661        $paged = max( get_query_var( 'paged' ), 1 );
    16631662
    16641663        if ( null === $label )
    16651664                $label = __( '« Previous Page' );