Changeset 3311
- Timestamp:
- 12/15/2005 08:31:29 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions-post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-post.php
r3303 r3311 505 505 506 506 // Update category counts. 507 foreach ( $post_categories as $cat_id ) { 507 $all_affected_cats = array_unique(array_merge($post_categories, $old_categories)); 508 foreach ( $all_affected_cats as $cat_id ) { 508 509 $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat, $wpdb->posts WHERE $wpdb->posts.ID=$wpdb->post2cat.post_id AND post_status='publish' AND category_id = '$cat_id'"); 509 510 $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'");
Note: See TracChangeset
for help on using the changeset viewer.