wp_update_term_count

Advertisement

Summery Summery

Updates the amount of terms in taxonomy.

Syntax Syntax

wp_update_term_count( int|array $terms, string $taxonomy, bool $do_deferred = false )

Description Description

If there is a taxonomy callback applied, then it will be called for updating the count.

The default action is to count what the amount of terms have the relationship of term ID. Once that is done, then update the database.

Parameters Parameters

$terms

(Required) The term_taxonomy_id of the terms.

$taxonomy

(Required) The context of the term.

$do_deferred

(Optional) Whether to flush the deferred term counts too.

Default value: false

Return Return

(bool) If no terms will return false, and if successful will return true.

Source Source

File: wp-includes/taxonomy.php

	 *
	 * @since 2.9.0
	 *
	 * @param int    $tt_id    Term taxonomy ID.
	 * @param string $taxonomy Taxonomy slug.
	 */
	do_action( 'edited_term_taxonomy', $tt_id, $taxonomy );

	/**
	 * Fires after a term has been updated, but before the term cache has been cleaned.
	 *
	 * @since 2.3.0
	 *
	 * @param int    $term_id  Term ID.
	 * @param int    $tt_id    Term taxonomy ID.
	 * @param string $taxonomy Taxonomy slug.
	 */
	do_action( 'edit_term', $term_id, $tt_id, $taxonomy );

	/**
	 * Fires after a term in a specific taxonomy has been updated, but before the term
	 * cache has been cleaned.
	 *
	 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
	 *
	 * @since 2.3.0
	 *
	 * @param int $term_id Term ID.

Advertisement

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Advertisement

Leave a Reply