wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
_update_generic_term_count › WordPress Function
Desde3.3.0
Obsoleton/a
› _update_generic_term_count ( $terms, $taxonomy )
Parâmetros: (2) |
|
Definido em: |
|
Codex: |
Updates term count based on number of objects.
Default callback for the 'link_category' taxonomy.Funções relacionadas: wp_update_term_count, _update_post_term_count, wp_update_network_site_counts, wp_update_network_counts, wp_update_term_count_now
Fonte
function _update_generic_term_count( $terms, $taxonomy ) { global $wpdb; foreach ( (array) $terms as $term ) { $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term ) ); /** This action is documented in wp-includes/taxonomy.php */ do_action( 'edit_term_taxonomy', $term, $taxonomy->name ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); /** This action is documented in wp-includes/taxonomy.php */ do_action( 'edited_term_taxonomy', $term, $taxonomy->name ); } }