Changeset 19892 for trunk/wp-includes/class-wp.php
- Timestamp:
- 02/09/2012 09:04:36 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp.php
r19712 r19892 475 475 global $wp_query; 476 476 477 if ( !is_admin() && ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) { 477 // If we've already issued a 404, bail. 478 if ( is_404() ) 479 return; 480 481 // Never 404 for the admin, robots, or if we found posts. 482 if ( is_admin() || is_robots() || $wp_query->posts ) { 483 status_header( 200 ); 484 return; 485 } 486 487 // We will 404 for paged queries, as no posts were found. 488 if ( ! is_paged() ) { 489 478 490 // Don't 404 for these queries if they matched an object. 479 if ( ( is_tag() || is_category() || is_tax() || is_author() || is_post_type_archive() ) && $wp_query->get_queried_object() && !is_paged() ) { 480 if ( !is_404() ) 481 status_header( 200 ); 491 if ( ( is_tag() || is_category() || is_tax() || is_author() || is_post_type_archive() ) && $wp_query->get_queried_object() ) { 492 status_header( 200 ); 482 493 return; 483 494 } 484 $wp_query->set_404(); 485 status_header( 404 ); 486 nocache_headers(); 487 } elseif ( !is_404() ) { 488 status_header( 200 ); 489 } 495 496 // Don't 404 for these queries either. 497 if ( is_home() || is_search() ) { 498 status_header( 200 ); 499 return; 500 } 501 } 502 503 // Guess it's time to 404. 504 $wp_query->set_404(); 505 status_header( 404 ); 506 nocache_headers(); 490 507 } 491 508
Note: See TracChangeset
for help on using the changeset viewer.