Ticket #8018: comment_threaded.patch
| File comment_threaded.patch, 3.1 KB (added by , 17 years ago) |
|---|
-
wp-includes/comment-template.php
1129 1129 <?php comment_text() ?> 1130 1130 1131 1131 <div class="reply"> 1132 <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args[' depth']))) ?>1132 <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?> 1133 1133 </div> 1134 1134 <?php if ( 'ul' == $args['style'] ) : ?> 1135 1135 </div> … … 1176 1176 $comment_alt = $comment_thread_alt = 0; 1177 1177 $comment_depth = 1; 1178 1178 1179 $defaults = array('walker' => null, ' depth' => '', 'style' => 'ul', 'callback' => null, 'end-callback' => null, 'type' => 'all',1179 $defaults = array('walker' => null, 'max_depth' => '', 'style' => 'ul', 'callback' => null, 'end-callback' => null, 'type' => 'all', 1180 1180 'page' => '', 'per_page' => '', 'avatar_size' => 32, 'reverse_top_level' => null, 'reverse_children' => ''); 1181 1181 1182 1182 $r = wp_parse_args( $args, $defaults ); … … 1189 1189 $r['page'] = 0; 1190 1190 } 1191 1191 1192 if ( '' === $r[' depth'] ) {1192 if ( '' === $r['max_depth'] ) { 1193 1193 if ( get_option('thread_comments') ) 1194 $r[' depth'] = get_option('thread_comments_depth');1194 $r['max_depth'] = get_option('thread_comments_depth'); 1195 1195 else 1196 $r[' depth'] = -1;1196 $r['max_depth'] = -1; 1197 1197 } 1198 1198 1199 1199 if ( '' === $r['page'] ) { … … 1203 1203 if ( empty($overridden_cpage) ) { 1204 1204 $r['page'] = get_query_var('cpage'); 1205 1205 } else { 1206 $threaded = ( -1 == $r[' depth'] ) ? false : true;1206 $threaded = ( -1 == $r['max_depth'] ) ? false : true; 1207 1207 $r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($comments, $r['per_page'], $threaded) : 1; 1208 1208 set_query_var( 'cpage', $r['page'] ); 1209 1209 } … … 1230 1230 $wp_query->comments_by_type = &separate_comments($wp_query->comments); 1231 1231 if ( empty($wp_query->comments_by_type[$type]) ) 1232 1232 return; 1233 $walker->paged_walk($wp_query->comments_by_type[$type], $ depth, $page, $per_page, $r);1233 $walker->paged_walk($wp_query->comments_by_type[$type], $max_depth, $page, $per_page, $r); 1234 1234 $wp_query->max_num_comment_pages = $walker->max_pages; 1235 1235 return; 1236 1236 } 1237 $walker->paged_walk($wp_query->comments, $ depth, $page, $per_page, $r);1237 $walker->paged_walk($wp_query->comments, $max_depth, $page, $per_page, $r); 1238 1238 $wp_query->max_num_comment_pages = $walker->max_pages; 1239 1239 } else { 1240 1240 if ( empty($comments) ) … … 1243 1243 $comments_by_type = &separate_comments($comments); 1244 1244 if ( empty($comments_by_type[$type]) ) 1245 1245 return; 1246 $walker->paged_walk($comments_by_type[$type], $ depth, $page, $per_page, $r);1246 $walker->paged_walk($comments_by_type[$type], $max_depth, $page, $per_page, $r); 1247 1247 $wp_query->max_num_comment_pages = $walker->max_pages; 1248 1248 return; 1249 1249 } 1250 $walker->paged_walk($comments, $ depth, $page, $per_page, $r);1250 $walker->paged_walk($comments, $max_depth, $page, $per_page, $r); 1251 1251 $wp_query->max_num_comment_pages = $walker->max_pages; 1252 1252 } 1253 1253 }