Make WordPress Core

Ticket #16717: 16717.2.diff

File 16717.2.diff, 899 bytes (added by nacin, 15 years ago)

Also handle the tag block.

  • wp-includes/query.php

     
    21852185                                if ( !empty( $cat_query ) ) {
    21862186                                        $cat_query = reset( $cat_query );
    21872187                                        $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
    2188                                         if ( $the_cat ) {
     2188                                        if ( $the_cat && ! is_wp_error( $the_cat ) ) {
    21892189                                                $this->set( 'cat', $the_cat->term_id );
    21902190                                                $this->set( 'category_name', $the_cat->slug );
    21912191                                        }
     
    21972197                                if ( !empty( $tag_query ) ) {
    21982198                                        $tag_query = reset( $tag_query );
    21992199                                        $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' );
    2200                                         if ( $the_tag ) {
     2200                                        if ( $the_tag && ! is_wp_error( $the_tag ) ) {
    22012201                                                $this->set( 'tag_id', $the_tag->term_id );
    22022202                                        }
    22032203                                        unset( $the_tag );