Changeset 30239
- Timestamp:
- 11/05/2014 01:08:44 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r30238 r30239 2055 2055 $where_fields = array($slug); 2056 2056 $else_where_fields = array($term); 2057 $orderby = 'ORDER BY t.term_id ASC'; 2058 $limit = 'LIMIT 1'; 2057 2059 if ( !empty($taxonomy) ) { 2058 2060 if ( is_numeric( $parent ) ) { … … 2067 2069 $else_where_fields[] = $taxonomy; 2068 2070 2069 if ( $result = $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s ", $where_fields), ARRAY_A) )2071 if ( $result = $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s $orderby $limit", $where_fields), ARRAY_A) ) 2070 2072 return $result; 2071 2073 2072 return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s ", $else_where_fields), ARRAY_A);2073 } 2074 2075 if ( $result = $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where ", $where_fields) ) )2074 return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s $orderby $limit", $else_where_fields), ARRAY_A); 2075 } 2076 2077 if ( $result = $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where $orderby $limit", $where_fields) ) ) 2076 2078 return $result; 2077 2079 2078 return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $else_where ", $else_where_fields) );2080 return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $else_where $orderby $limit", $else_where_fields) ); 2079 2081 } 2080 2082
Note: See TracChangeset
for help on using the changeset viewer.