Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rileypaulsen/5960475 to your computer and use it in GitHub Desktop.
Save rileypaulsen/5960475 to your computer and use it in GitHub Desktop.
update the term count on admin term management page
$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