Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_update_term_count_now [ WordPress Function ]

wp_update_term_count_now ( $terms, $taxonomy )
Parameters:
  • (array) $terms The term_taxonomy_id of terms to update.
  • (string) $taxonomy The context of the term.
Returns:
  • (bool) Always true when complete.
Defined at:



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 ( 
=== 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

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics