Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#21978 closed enhancement (duplicate)

Introduce an action before 404 headers are sent

Reported by: ethitter Owned by:
Priority: normal Milestone:
Component: Query Version: 3.4.2
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Currently there are actions that fire after the requested URL is parsed, but none between when the parsed query arguments are attempted and the 404 header is sent. As a result, hooking in to redirect 404 requests must happen at parse_request, adding overhead where it often isn't needed. The attached patch introduces an action immediately before the 404 headers are sent.

This is useful for a variety of reasons, such as when a site migrates from a different CMS. If post slugs are maintained, WordPress handles the redirection, but special cases may exist where manual redirection is needed. By waiting until after WordPress has made its various attempts at locating the requested content, logic related to these redirects could be simplified, and the number of times this logic fires can be greatly reduced.

Attachments (1)

21978.patch (397 bytes ) - added by ethitter 14 years ago.

Download all attachments as: .zip

Change History (2)

@ethitter
14 years ago

#1 @nacin
14 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #10722, also of #11312.

Note: See TracTickets for help on using tickets.