Make WordPress Core

Ticket #10722: 10722.patch

File 10722.patch, 1.1 KB (added by hakre, 15 years ago)
  • wp-includes/classes.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    461461
    462462                if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
    463463                        // Don't 404 for these queries if they matched an object.
    464                         if ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) {
    465                                 if ( !is_404() )
    466                                         status_header( 200 );
    467                                 return;
     464                        if ( !( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) ) {
     465                                if ( apply_filters( 'handle_404', $handle_404 ) ) {
     466                                        $wp_query->set_404();
     467                                        status_header( 404 );
     468                                        nocache_headers();
     469                                }
    468470                        }
    469                         $wp_query->set_404();
    470                         status_header( 404 );
    471                         nocache_headers();
    472                 } elseif ( !is_404() ) {
     471                }
     472
     473                if ( !is_404() )
    473474                        status_header( 200 );
    474                 }
    475475        }
    476476
    477477        /**