Changeset 9317
- Timestamp:
- 10/24/2008 07:27:19 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment-template.php
r9296 r9317 731 731 */ 732 732 function comments_template( $file = '/comments.php', $separate_comments = false ) { 733 global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity ;733 global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage; 734 734 735 735 if ( ! (is_single() || is_page() || $withcomments) ) … … 763 763 } 764 764 765 if ( '' == get_query_var('cpage') && get_option('page_comments') && 'newest' == get_option('default_comments_page') ) 765 $overridden_cpage = FALSE; 766 if ( '' == get_query_var('cpage') && get_option('page_comments') && 'newest' == get_option('default_comments_page') ) { 766 767 set_query_var( 'cpage', get_comment_pages_count() ); 768 $overridden_cpage = TRUE; 769 } 767 770 768 771 define('COMMENTS_TEMPLATE', true); … … 1130 1133 */ 1131 1134 function wp_list_comments($args = array(), $comments = null ) { 1132 global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt ;1135 global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage; 1133 1136 1134 1137 $comment_alt = $comment_thread_alt = 0; … … 1159 1162 $r['page'] = get_query_var('cpage'); 1160 1163 } else { 1161 $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'] ); 1164 if ( empty($overridden_cpage) ) { 1165 $r['page'] = get_query_var('cpage'); 1166 } else { 1167 $threaded = ( -1 == $r['depth'] ) ? false : true; 1168 $r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($comments, $r['per_page'], $threaded) : 1; 1169 set_query_var( 'cpage', $r['page'] ); 1170 } 1164 1171 } 1165 1172 }
Note: See TracChangeset
for help on using the changeset viewer.