Last active
December 19, 2015 13:09
-
-
Save rileypaulsen/5960475 to your computer and use it in GitHub Desktop.
update the term count on admin term management page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$taxs = get_taxonomies(); | |
foreach($taxs as $tax){ | |
$args = array( | |
'hide_empty'=> false, | |
); | |
$terms = get_terms($tax,$args); | |
$termIDs = array(); //we need an array of IDs from all the terms in this taxonomy | |
foreach($terms as $term){ | |
$termIDs[] = $term->term_id; | |
} | |
wp_update_term_count_now($termIDs,$tax); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment