WordPress.org

Make WordPress Core

Ticket #11312: handle_404.diff

File handle_404.diff, 748 bytes (added by mikeschinkel, 4 years ago)

Added a 'handle_404' hook to the $wp->handle_404() method on /wp-includes/classes.php

  • classes.php

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: /Users/mikeschinkel/Sites/wordpress/trunk/wp-includes
    # This patch can be applied using context Tools: Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    466466                                        status_header( 200 ); 
    467467                                return; 
    468468                        } 
     469                        if (apply_filters('handle_404',false)) 
     470        status_header( 200 ); 
     471      else { 
    469472                        $wp_query->set_404(); 
    470473                        status_header( 404 ); 
    471474                        nocache_headers(); 
     475      } 
    472476                } elseif ( !is_404() ) { 
    473477                        status_header( 200 ); 
    474478                }