[wp-trac] [WordPress Trac] #21978: Introduce an action before 404 headers are sent
WordPress Trac
wp-trac at lists.automattic.com
Sun Sep 23 20:23:15 UTC 2012
#21978: Introduce an action before 404 headers are sent
-----------------------------+-------------------------
Reporter: ethitter | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Query
Version: 3.4.2 | Severity: normal
Keywords: has-patch |
-----------------------------+-------------------------
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21978>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list