wp_update_term_count [ WordPress Function ]
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
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.
Source
<?php
function wp_update_term_count( $terms, $taxonomy, $do_deferred=false ) {
static $_deferred = array();
if ( $do_deferred ) {
foreach ( (array) array_keys($_deferred) as $tax ) {
wp_update_term_count_now( $_deferred[$tax], $tax );
unset( $_deferred[$tax] );
}
}
if ( empty($terms) )
return false;
if ( !is_array($terms) )
$terms = array($terms);
if ( wp_defer_term_counting() ) {
if ( !isset($_deferred[$taxonomy]) )
$_deferred[$taxonomy] = array();
$_deferred[$taxonomy] = array_unique( array_merge($_deferred[$taxonomy], $terms) );
return true;
}
return wp_update_term_count_now( $terms, $taxonomy );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- #18631 (wp_set_object_terms() should only wp_update_term_count ...
Currently, after creating/inserting any new terms passed in via the $terms argument, wp_set_object_terms() will run wp_update_term_count() on all of the $ terms ...
core.trac.wordpress.org - #5375 (wp_update_term_count cleans the cache for all taxonomies ...
wp_update_term_count() doesn't pass the taxonomy name on to clean_term_cache(). This causes clean_term_cache() to run some unnecessary queries and ...
core.trac.wordpress.org - wp_update_term_count (WordPress Function) - WPSeek.com
WordPress lookup for wp_update_term_count, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Docs for page functions.wp-taxonomy.php
void wp_update_term_count ( $terms, $taxonomy, [ $do_deferred = false]). $ terms; $taxonomy; $do_deferred. wp_update_term_count_now (line 137) ...
phpdoc.ftwr.co.uk