Changeset 5866
- Timestamp:
- 08/14/2007 02:54:02 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/taxonomy.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r5865 r5866 790 790 791 791 $taxonomy = get_taxonomy($taxonomy); 792 if ( isset($taxonomy->update_count_callback) )792 if ( !empty($taxonomy->update_count_callback) ) 793 793 return call_user_func($taxonomy->update_count_callback, $terms); 794 794 795 795 // Default count updater 796 $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = '$term'"); 797 $wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term'"); 796 foreach ($terms as $term) { 797 $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = '$term'"); 798 $wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term'"); 799 } 798 800 799 801 return true;
Note: See TracChangeset
for help on using the changeset viewer.