Make WordPress Core

Ticket #16717: 16717.diff

File 16717.diff, 557 bytes (added by kawauso, 15 years ago)

Thanks to rboren for confirming the method, check !is_wp_error()

  • 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                                        }