Switch language

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




_update_generic_term_count [ WordPress Function ]

_update_generic_term_count ( $terms, $taxonomy )
Parameters:
  • (array) $terms List of Term taxonomy IDs
  • (object) $taxonomy Current taxonomy object of terms
Uses:
  • $wpdb
Defined at:



Will update term count based on number of objects.

Default callback for the link_category taxonomy.

Source


<?php
function _update_generic_term_count$terms$taxonomy ) {
    global 
$wpdb;

    foreach ( (array) 
$terms as $term ) {
        
$count $wpdb->get_var$wpdb->prepare"SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d"$term ) );

        
do_action'edit_term_taxonomy'$term$taxonomy );
        
$wpdb->update$wpdb->term_taxonomycompact'count' ), array( 'term_taxonomy_id' => $term ) );
        
do_action'edited_term_taxonomy'$term$taxonomy );
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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