Make WordPress Core

Changeset 8761


Ignore:
Timestamp:
08/28/2008 07:58:57 PM (16 years ago)
Author:
ryan
Message:

Don't 404 for categories, tags, and authors that exist but have no posts. see #5324

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r8646 r8761  
    295295        // permalink request.
    296296        if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
     297            // Don't 404 for these queries if they matched an object.
     298            if ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) {
     299                if ( !is_404() )
     300                    status_header( 200 );
     301                return;
     302            }
    297303            $wp_query->set_404();
    298304            status_header( 404 );
    299305            nocache_headers();
    300         }   elseif( is_404() != true ) {
     306        } elseif ( !is_404() ) {
    301307            status_header( 200 );
    302308        }
Note: See TracChangeset for help on using the changeset viewer.