_update_generic_term_count

Advertisement

Summery Summery

Will update term count based on number of objects.

Syntax Syntax

_update_generic_term_count( int[] $terms, WP_Taxonomy $taxonomy )

Description Description

Default callback for the ‘link_category’ taxonomy.

Parameters Parameters

$terms

(Required) List of term taxonomy IDs.

$taxonomy

(Required) Current taxonomy object of terms.

Source Source

File: wp-includes/taxonomy.php

			if ( ! empty( $term_items[ $term_id ] ) ) {
				foreach ( $term_items[ $term_id ] as $item_id => $touches ) {
					$term_items[ $parent ][ $item_id ] = isset( $term_items[ $parent ][ $item_id ] ) ? ++$term_items[ $parent ][ $item_id ] : 1;
				}
			}

			$child = $parent;

			if ( in_array( $parent, $ancestors, true ) ) {
				break;
			}
		}
	}

Advertisement

Changelog Changelog

Changelog
Version Description
3.3.0 Introduced.

Advertisement

Leave a Reply