mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Revert [18783], as it breaks term relationship counts for attachment taxonomies. see #17548.
git-svn-id: https://develop.svn.wordpress.org/trunk@18809 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2445,7 +2445,13 @@ function wp_update_term_count_now( $terms, $taxonomy ) {
|
||||
call_user_func($taxonomy->update_count_callback, $terms, $taxonomy);
|
||||
} else {
|
||||
// Default count updater
|
||||
_update_post_term_count( $terms, $taxonomy );
|
||||
foreach ( (array) $terms as $term) {
|
||||
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term) );
|
||||
do_action( 'edit_term_taxonomy', $term, $taxonomy );
|
||||
$wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) );
|
||||
do_action( 'edited_term_taxonomy', $term, $taxonomy );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
clean_term_cache($terms, '', false);
|
||||
|
||||
Reference in New Issue
Block a user