Changeset 3104 for trunk/wp-admin/upgrade-functions.php
- Timestamp:
- 11/16/2005 06:29:36 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/upgrade-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-functions.php
r3092 r3104 31 31 } 32 32 33 if ( $wp_current_db_version < 3 092)33 if ( $wp_current_db_version < 3104 ) 34 34 upgrade_160(); 35 35 … … 301 301 } 302 302 } 303 303 304 // populate comment_count field of posts table 305 $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments GROUP BY comment_post_ID" ); 306 if( is_array( $comments ) ) { 307 foreach ($comments as $comment) { 308 $wpdb->query( "UPDATE $wpdb->posts SET comment_count = $comment->c WHERE ID = '$comment->comment_post_ID}'" ); 309 } 310 } 311 304 312 // Some alpha versions used a post status of object instead of attachment and put 305 313 // the mime type in post_type instead of post_mime_type.
Note: See TracChangeset
for help on using the changeset viewer.