Changeset 34161
- Timestamp:
- 09/15/2015 01:46:51 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r34130 r34161 372 372 if ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) { 373 373 $post_id = 0; 374 $status = 'total_comments'; // What type of comment count are we looking for? 374 // What type of comment count are we looking for? 375 $status = 'all'; 375 376 $parsed = parse_url( $url ); 376 377 if ( isset( $parsed['query'] ) ) { -
trunk/src/wp-includes/comment-functions.php
r34158 r34161 363 363 'post-trashed' => 0, 364 364 'total_comments' => 0, 365 'all' => 0, 365 366 ); 366 367 … … 380 381 $comment_count['approved'] = $row['total']; 381 382 $comment_count['total_comments'] += $row['total']; 383 $comment_count['all'] += $row['total']; 382 384 break; 383 385 case '0': 384 386 $comment_count['awaiting_moderation'] = $row['total']; 385 387 $comment_count['total_comments'] += $row['total']; 388 $comment_count['all'] += $row['total']; 386 389 break; 387 390 default: -
trunk/tests/phpunit/tests/comment/wpCountComments.php
r34136 r34161 12 12 $this->assertEquals( 0, $count->{'post-trashed'} ); 13 13 $this->assertEquals( 0, $count->total_comments ); 14 $this->assertEquals( 0, $count->all ); 14 15 } 15 16 … … 27 28 $this->assertEquals( 0, $count->{'post-trashed'} ); 28 29 $this->assertEquals( 1, $count->total_comments ); 30 $this->assertEquals( 1, $count->all ); 29 31 } 30 32 … … 42 44 $this->assertEquals( 0, $count->{'post-trashed'} ); 43 45 $this->assertEquals( 1, $count->total_comments ); 46 $this->assertEquals( 1, $count->all ); 44 47 } 45 48 … … 57 60 $this->assertEquals( 0, $count->{'post-trashed'} ); 58 61 $this->assertEquals( 1, $count->total_comments ); 62 $this->assertEquals( 0, $count->all ); 59 63 } 60 64 … … 72 76 $this->assertEquals( 0, $count->{'post-trashed'} ); 73 77 $this->assertEquals( 0, $count->total_comments ); 78 $this->assertEquals( 0, $count->all ); 74 79 } 75 80 … … 87 92 $this->assertEquals( 1, $count->{'post-trashed'} ); 88 93 $this->assertEquals( 0, $count->total_comments ); 94 $this->assertEquals( 0, $count->all ); 89 95 } 90 96 … … 106 112 $this->assertEquals( 0, $count1->{'post-trashed'} ); 107 113 $this->assertEquals( 1, $count1->total_comments ); 114 $this->assertEquals( 1, $count1->all ); 108 115 109 116 $all_count1 = wp_count_comments(); … … 115 122 $this->assertEquals( 0, $all_count1->{'post-trashed'} ); 116 123 $this->assertEquals( 1, $all_count1->total_comments ); 124 $this->assertEquals( 1, $all_count1->all ); 117 125 118 126 wp_spam_comment( $comment_id ); … … 126 134 $this->assertEquals( 0, $count2->{'post-trashed'} ); 127 135 $this->assertEquals( 1, $count2->total_comments ); 136 $this->assertEquals( 0, $count2->all ); 128 137 129 138 $all_count2 = wp_count_comments(); … … 135 144 $this->assertEquals( 0, $all_count2->{'post-trashed'} ); 136 145 $this->assertEquals( 1, $all_count2->total_comments ); 146 $this->assertEquals( 0, $all_count2->all ); 137 147 138 148 wp_trash_comment( $comment_id ); … … 146 156 $this->assertEquals( 0, $count3->{'post-trashed'} ); 147 157 $this->assertEquals( 0, $count3->total_comments ); 158 $this->assertEquals( 0, $count3->all ); 148 159 149 160 $all_count3 = wp_count_comments(); … … 155 166 $this->assertEquals( 0, $all_count3->{'post-trashed'} ); 156 167 $this->assertEquals( 0, $all_count3->total_comments ); 168 $this->assertEquals( 0, $all_count3->all ); 157 169 158 170 wp_untrash_comment( $comment_id ); … … 166 178 $this->assertEquals( 0, $count4->{'post-trashed'} ); 167 179 $this->assertEquals( 1, $count4->total_comments ); 180 $this->assertEquals( 0, $count4->all ); 168 181 169 182 $all_count4 = wp_count_comments(); … … 175 188 $this->assertEquals( 0, $all_count4->{'post-trashed'} ); 176 189 $this->assertEquals( 1, $all_count4->total_comments ); 190 $this->assertEquals( 0, $all_count4->all ); 177 191 } 178 192 }
Note: See TracChangeset
for help on using the changeset viewer.