Ticket #16717: 16717.patch
| File 16717.patch, 1.6 KB (added by , 15 years ago) |
|---|
-
wp-includes/query.php
2190 2190 if ( !empty( $cat_query ) ) { 2191 2191 $cat_query = reset( $cat_query ); 2192 2192 $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' ); 2193 if ( $the_cat && ! is_wp_error( $the_cat )) {2193 if ( $the_cat ) { 2194 2194 $this->set( 'cat', $the_cat->term_id ); 2195 2195 $this->set( 'category_name', $the_cat->slug ); 2196 2196 } … … 2202 2202 if ( !empty( $tag_query ) ) { 2203 2203 $tag_query = reset( $tag_query ); 2204 2204 $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' ); 2205 if ( $the_tag && ! is_wp_error( $the_tag )) {2205 if ( $the_tag ) { 2206 2206 $this->set( 'tag_id', $the_tag->term_id ); 2207 2207 } 2208 2208 unset( $the_tag ); -
wp-includes/taxonomy.php
887 887 $value = stripslashes($value); 888 888 $field = 't.name'; 889 889 } else { 890 return get_term( (int) $value, $taxonomy, $output, $filter); 890 $term = get_term( (int) $value, $taxonomy, $output, $filter); 891 if ( is_wp_error( $term ) ) 892 $term = false; 893 return $term; 891 894 } 892 895 893 896 $term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND $field = %s LIMIT 1", $taxonomy, $value) );