Changeset 10416
- Timestamp:
- 01/22/2009 10:59:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r10275 r10416 737 737 $where .= ' AND tt.count > 0'; 738 738 739 if ( !empty($number) ) { 739 // don't limit the query results when we have to descend the family tree 740 if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' == $parent ) { 740 741 if( $offset ) 741 $ number= 'LIMIT ' . $offset . ',' . $number;742 $limit = 'LIMIT ' . $offset . ',' . $number; 742 743 else 743 $ number= 'LIMIT ' . $number;744 $limit = 'LIMIT ' . $number; 744 745 745 746 } else 746 $ number= '';747 $limit = ''; 747 748 748 749 if ( !empty($search) ) { … … 759 760 $select_this = 't.term_id, tt.parent, tt.count, t.name'; 760 761 761 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $number"; 762 762 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $limit"; 763 764 $terms = $wpdb->get_results($query); 763 765 if ( 'all' == $fields ) { 764 $terms = $wpdb->get_results($query);765 766 update_term_cache($terms); 766 } else if ( ('ids' == $fields) || ('names' == $fields) ) {767 $terms = $wpdb->get_results($query);768 767 } 769 768 … … 811 810 $_terms[] = $term->name; 812 811 $terms = $_terms; 812 } 813 814 if ( 0 < $number && intval(@count($terms)) > $number ) { 815 $terms = array_slice($terms, $offset, $number); 813 816 } 814 817
Note: See TracChangeset
for help on using the changeset viewer.