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

wp_update_term_count_now() WP 2.5.0

Perform term count update immediately.

Хуков нет.

Возвращает

true. Always true when complete.

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

wp_update_term_count_now( $terms, $taxonomy );
$terms(массив) (обязательный)
The term_taxonomy_id of terms to update.
$taxonomy(строка) (обязательный)
The context of the term.

Список изменений

С версии 2.5.0 Введена.

Код wp_update_term_count_now() WP 5.5.3

<?php
function wp_update_term_count_now( $terms, $taxonomy ) {
	$terms = array_map( 'intval', $terms );

	$taxonomy = get_taxonomy( $taxonomy );
	if ( ! empty( $taxonomy->update_count_callback ) ) {
		call_user_func( $taxonomy->update_count_callback, $terms, $taxonomy );
	} else {
		$object_types = (array) $taxonomy->object_type;
		foreach ( $object_types as &$object_type ) {
			if ( 0 === strpos( $object_type, 'attachment:' ) ) {
				list( $object_type ) = explode( ':', $object_type );
			}
		}

		if ( array_filter( $object_types, 'post_type_exists' ) == $object_types ) {
			// Only post types are attached to this taxonomy.
			_update_post_term_count( $terms, $taxonomy );
		} else {
			// Default count updater.
			_update_generic_term_count( $terms, $taxonomy );
		}
	}

	clean_term_cache( $terms, '', false );

	return true;
}