WordPress.org

Make WordPress Core

Ticket #7927: 7927.2.diff

File 7927.2.diff, 1.1 KB (added by DD32, 10 years ago)

untested, but is virtually identical to the last, POC for viper's OK'ing

  • wp-includes/comment-template.php

     
    11551155        }
    11561156
    11571157        if ( '' === $r['page'] ) {
    1158                 if ( empty($comments) ) {
    1159                         $r['page'] = get_query_var('cpage');
    1160                 } else {
     1158                if ( 'newest' == get_option('default_comments_page') ) {
    11611159                        $threaded = ( -1 == $r['depth'] ) ? false : true;
    1162                         $r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($comments, $r['per_page'], $threaded) : 1;
    1163                         set_query_var( 'cpage', $r['page'] );
     1160                        set_query_var( 'cpage', get_comment_pages_count($comments, $r['per_page'], $threaded) );
    11641161                }
     1162                $r['page'] = get_query_var('cpage');
    11651163        }
    11661164        // Validation check
    11671165        $r['page'] = intval($r['page']);
     
    11691167                $r['page'] = 1;
    11701168
    11711169        if ( '' == $r['reverse_top_level'] )
    1172                 $r['reverse_top_level'] = ( 'asc' == get_option('comment_order') ) ? FALSE : TRUE;
     1170                $r['reverse_top_level'] = ( 'asc' == get_option('comment_order') ) ? false : true;
    11731171
    11741172        extract( $r, EXTR_SKIP );
    11751173