WordPress.org

Make WordPress Core

Ticket #10722: 10722.diff

File 10722.diff, 705 bytes (added by Denis-de-Bernardy, 8 years ago)
  • wp-includes/classes.php

     
    474474        function handle_404() {
    475475                global $wp_query;
    476476
    477                 if ( ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) {
     477                if ( ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() && apply_filters('handle_404', true, $wp_query) ) {
    478478                        // Don't 404 for these queries if they matched an object.
    479479                        if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() ) {
    480480                                if ( !is_404() )