WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/29/2011 05:29:20 AM (9 years ago)
Author:
nacin
Message:

Revert [18783], as it breaks term relationship counts for attachment taxonomies. see #17548.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r18783 r18809  
    24462446    } else {
    24472447        // Default count updater
    2448         _update_post_term_count( $terms, $taxonomy );
     2448        foreach ( (array) $terms as $term) {
     2449            $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term) );
     2450            do_action( 'edit_term_taxonomy', $term, $taxonomy );
     2451            $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) );
     2452            do_action( 'edited_term_taxonomy', $term, $taxonomy );
     2453        }
     2454
    24492455    }
    24502456
Note: See TracChangeset for help on using the changeset viewer.