Changeset 5596
- Timestamp:
- 05/30/2007 01:05:44 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r5594 r5596 40 40 } 41 41 42 function wp_count_terms( $taxonomy ) { 43 global $wpdb; 44 45 return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy'"); 42 function wp_count_terms( $taxonomy, $args = array() ) { 43 global $wpdb; 44 45 $defaults = array('ignore_empty' => false); 46 $args = wp_parse_args($args, $defaults); 47 extract($args); 48 49 $where = ''; 50 if ( $ignore_empty ) 51 $where = 'AND count > 0'; 52 53 return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy' $where"); 46 54 } 47 55
Note: See TracChangeset
for help on using the changeset viewer.