Changeset 5815 for trunk/wp-admin/includes/upgrade.php
- Timestamp:
- 07/21/2007 09:52:35 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/upgrade.php
r5814 r5815 671 671 } 672 672 673 // TODO: Recalculate all counts 673 // Recalculate all counts 674 $terms = $wpdb->get_col("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy"); 675 foreach ( (array) $terms as $term ) { 676 $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = '$term'"); 677 $wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term'"); 678 } 674 679 } 675 680
Note: See TracChangeset
for help on using the changeset viewer.