Changeset 13315
- Timestamp:
- 02/22/2010 10:54:21 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r13194 r13315 462 462 463 463 /** 464 * Set the Headers for 404, if permalink is not found. 465 * 466 * Issue a 404 if a permalink request doesn't match any posts. Don't issue 467 * a 404 if one was already issued, if the request was a search, or if the 468 * request was a regular query string request rather than a permalink 469 * request. Issues a 200, if not 404. 464 * Set the Headers for 404, if nothing is found for requested URL. 465 * 466 * Issue a 404 if a request doesn't match any posts and doesn't match 467 * any object (e.g. an existing-but-empty category, tag, author) and a 404 was not already 468 * issued, and if the request was not a search or the homepage. 469 * 470 * Otherwise, issue a 200. 470 471 * 471 472 * @since 2.0.0 … … 474 475 global $wp_query; 475 476 476 if ( ( 0 == count($wp_query->posts)) && !is_404() && !is_robots() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?')))) ) {477 if ( ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_search() && !is_home() ) { 477 478 // Don't 404 for these queries if they matched an object. 478 if ( ( is_tag() || is_category() || is_ author() ) && $wp_query->get_queried_object() ) {479 if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() ) { 479 480 if ( !is_404() ) 480 481 status_header( 200 );
Note: See TracChangeset
for help on using the changeset viewer.