diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index 531fd53..721efaf 100644
a
|
b
|
foreach ( array( 'term_name_rss' ) as $filter ) { |
127 | 127 | add_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 ); |
128 | 128 | add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); |
129 | 129 | |
| 130 | // Pad terms count hierarchy loop detection |
| 131 | add_filter( '_pad_term_counts_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); |
| 132 | |
130 | 133 | // Display filters |
131 | 134 | add_filter( 'the_title', 'wptexturize' ); |
132 | 135 | add_filter( 'the_title', 'convert_chars' ); |
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 955369e..2bdd7fd 100644
a
|
b
|
function _pad_term_counts(&$terms, $taxonomy) { |
2969 | 2969 | foreach ( $term_ids as $term_id ) { |
2970 | 2970 | $child = $term_id; |
2971 | 2971 | while ( !empty( $terms_by_id[$child] ) && $parent = $terms_by_id[$child]->parent ) { |
| 2972 | |
| 2973 | // Check $parent to see if it will cause a hierarchy loop |
| 2974 | $parent = apply_filters( '_pad_term_counts_term_parent', $parent, $term_id, $taxonomy ); |
| 2975 | |
2972 | 2976 | if ( !empty( $term_items[$term_id] ) ) |
2973 | 2977 | foreach ( $term_items[$term_id] as $item_id => $touches ) { |
2974 | 2978 | $term_items[$parent][$item_id] = isset($term_items[$parent][$item_id]) ? ++$term_items[$parent][$item_id]: 1; |