wpseek.com
WordPress开发者和主题制作者的搜索引擎
_update_generic_term_count › WordPress Function
Since3.3.0
已弃用n/a
› _update_generic_term_count ( $terms, $taxonomy )
参数: (2) |
|
定义在: |
|
文档: |
Updates term count based on number of objects.
Default callback for the 'link_category' taxonomy.源码
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 ) ); /** This action is documented in wp-includes/taxonomy.php */ do_action( 'edit_term_taxonomy', $term, $taxonomy->name ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); /** This action is documented in wp-includes/taxonomy.php */ do_action( 'edited_term_taxonomy', $term, $taxonomy->name ); } }