mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 14:35:07 +00:00
Recalculate counts
git-svn-id: http://svn.automattic.com/wordpress/trunk@5815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a7720182d1
commit
00ac511053
@ -670,7 +670,12 @@ function upgrade_230() {
|
||||
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories');
|
||||
}
|
||||
|
||||
// TODO: Recalculate all counts
|
||||
// Recalculate all counts
|
||||
$terms = $wpdb->get_col("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy");
|
||||
foreach ( (array) $terms as $term ) {
|
||||
$count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = '$term'");
|
||||
$wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term'");
|
||||
}
|
||||
}
|
||||
|
||||
function upgrade_old_slugs() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user