WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

_update_generic_term_count() WP 3.3.0

Will update term count based on number of objects.

Default callback for the 'link_category' taxonomy.

  • Global. wpdb. $wpdb WordPress database abstraction object.
Хуки из функции
Возвращает

Ничего (null).

Использование

_update_generic_term_count( $terms, $taxonomy );
$terms(массив) (обязательный)
List of term taxonomy IDs.
$taxonomy(объект) (обязательный)
Current taxonomy object of terms.

Код update generic term count: wp-includes/taxonomy.php VER 5.1.1

<?php
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 );
	}
}