- /*
- * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,
- * perform a separate comment query and allow Walker_Comment to paginate.
- */
- if ( is_singular() && ( $r['page'] || $r['per_page'] ) ) {
- $current_cpage = get_query_var( 'cpage' );
- if ( ! $current_cpage ) {
- $current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;
- }
-
- $current_per_page = get_query_var( 'comments_per_page' );
- if ( $r['page'] != $current_cpage || $r['per_page'] != $current_per_page ) {
- $comments = get_comments( array(
- 'post_id' => get_queried_object_id(),
- 'orderby' => 'comment_date_gmt',
- 'order' => 'ASC',
- 'status' => 'all',
- ) );
- }
- }
-