Changeset 16056
- Timestamp:
- 10/28/2010 05:55:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r15929 r16056 919 919 } 920 920 921 $in_taxonomies = "'" . implode("', '", $taxonomies) . "'";922 923 921 $defaults = array('orderby' => 'name', 'order' => 'ASC', 924 922 'hide_empty' => true, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(), … … 942 940 $args['pad_counts'] = false; 943 941 } 942 944 943 extract($args, EXTR_SKIP); 945 944 … … 992 991 $order = ''; 993 992 994 $where = '';993 $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')"; 995 994 $inclusions = ''; 996 995 if ( !empty($include) ) { … … 1059 1058 if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' === $parent ) { 1060 1059 if ( $offset ) 1061 $limit = 'LIMIT ' . $offset . ',' . $number;1060 $limits = 'LIMIT ' . $offset . ',' . $number; 1062 1061 else 1063 $limit = 'LIMIT ' . $number;1062 $limits = 'LIMIT ' . $number; 1064 1063 } else { 1065 $limit = '';1064 $limits = ''; 1066 1065 } 1067 1066 … … 1088 1087 $selects = array('COUNT(*)'); 1089 1088 } 1090 $select_this = implode(', ', apply_filters( 'get_terms_fields', $selects, $args )); 1091 1092 $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 $orderby $order $limit"; 1089 1090 $_fields = $fields; 1091 1092 $fields = implode(', ', apply_filters( 'get_terms_fields', $selects, $args )); 1093 1094 $join = "INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id"; 1095 1096 $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits' ); 1097 $clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args ); 1098 foreach ( $pieces as $piece ) 1099 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 1100 1101 $query = "SELECT $fields FROM $wpdb->terms AS t $join WHERE $where $orderby $order $limits"; 1102 1103 $fields = $_fields; 1093 1104 1094 1105 if ( 'count' == $fields ) {
Note: See TracChangeset
for help on using the changeset viewer.