Even better, array functions are fun.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-10-29 23:28:05 +00:00
parent 2718217d3b
commit ba2ba0e252
1 changed files with 4 additions and 4 deletions

View File

@ -1293,11 +1293,11 @@ function update_post_caches(&$posts) {
if ( $comment_counts ) {
foreach ($comment_counts as $comment_count) {
$comment_count_cache["$comment_count->comment_post_ID"] = $comment_count->ccount;
$got_count[] = $comment_count->comment_post_ID;
$has_comments[] = $comment_count->comment_post_ID;
}
foreach ( $post_id_array as $id )
if ( !in_array( $id, $got_count ) )
$comment_count_cache["$id"] = 0;
$no_comments = array_diff( $post_id_array, $has_comments );
foreach ( $no_comments as $id )
$comment_count_cache["$id"] = 0;
}
// Get post-meta info