Index: classes.php
===================================================================
--- classes.php	(revision 11893)
+++ classes.php	(working copy)
@@ -459,17 +459,20 @@
 	function handle_404() {
 		global $wp_query;
 
-		if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
-			// Don't 404 for these queries if they matched an object.
-			if ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) {
-				if ( !is_404() )
-					status_header( 200 );
-				return;
-			}
+		$handle_404 = false;
+
+		if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) && ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) ) {
+			$handle_404 = true;
+		}
+
+		if(apply_filters('handle_404', $handle_404))
+		{
 			$wp_query->set_404();
 			status_header( 404 );
 			nocache_headers();
-		} elseif ( !is_404() ) {
+		}
+		elseif(!is_404())
+		{
 			status_header( 200 );
 		}
 	}