Summery Summery
Removes the taxonomy relationship to terms from the cache.
Syntax Syntax
Description Description
Will remove the entire taxonomy relationship containing term $object_id. The term IDs have to exist within the taxonomy $object_type for the deletion to take place.
Parameters Parameters
- $object_ids
-
(Required) Single or list of term object ID(s).
- $object_type
-
(Required) The taxonomy object type.
Source Source
File: wp-includes/taxonomy.php
// Flush any deferred counts.
if ( ! $defer ) {
wp_update_term_count( null, null, true );
}
}
return $_defer;
}
/**
* Updates the amount of terms in taxonomy.
*
* 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.
*
* @since 2.3.0
*
* @param int|array $terms The term_taxonomy_id of the terms.
* @param string $taxonomy The context of the term.
* @param bool $do_deferred Whether to flush the deferred term counts too. Default false.
* @return bool If no terms will return false, and if successful will return true.
*/
function wp_update_term_count( $terms, $taxonomy, $do_deferred = false ) {
static $_deferred = array();
if ( $do_deferred ) {
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
See also See also
- get_object_taxonomies(): for more on $object_type.