wp_update_term_count_now [ WordPress Function ]
wp_update_term_count_now ( $terms, $taxonomy )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: wp_update_term_count, wp_update_comment_count_now, _update_post_term_count, wp_update_network_counts, wp_defer_term_counting
Perform term count update immediately.
Source
<?php
function wp_update_term_count_now( $terms, $taxonomy ) {
global $wpdb;
$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 ( $object_types == array_filter( $object_types, 'post_type_exists' ) ) {
// 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;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- #7357 (wp_update_term_count_now default behavior doesn't work ...
wp_update_term_count_now takes as its first argument an array of term ids, and the terms' taxonomy as its second. Then it updates the terms' counts based on ...
core.trac.wordpress.org - wp_update_term_count_now (WordPress Function) - WPSeek.com
WordPress lookup for wp_update_term_count_now, 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_now ( $terms, $taxonomy). $terms; $taxonomy. _get_term_children (line 172). void &_get_term_children ( $term_id, $terms, ...
phpdoc.ftwr.co.uk - posts - Custom Taxonomies Incorrectly Counting Revisions ...
Oct 21, 2010... functions in /wp-includes/taxonomy.php that update taxonomy term count: wp_update_term_count_now() and _update_post_term_count() .
wordpress.stackexchange.com