From f802fef76f6e1f479878cd2a98626b429f1df901 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 27 Sep 2015 18:27:15 +0000 Subject: [PATCH] Update the docs in `WP` to explain the need to do [34476]. Fixes #20226. git-svn-id: https://develop.svn.wordpress.org/trunk@34632 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php index 47f97d4d4d..0a1af19f0b 100644 --- a/src/wp-includes/class-wp.php +++ b/src/wp-includes/class-wp.php @@ -359,10 +359,12 @@ class WP { /** * Send additional HTTP headers for caching, content type, etc. * - * Sets the X-Pingback header, 404 status (if 404), Content-type. If showing - * a feed, it will also send last-modified, etag, and 304 status if needed. + * Sets the Content-Type header. + * Sets the 'error' status (if passed) and optionally exits. + * If showing a feed, it will also send Last-Modified, ETag, and 304 status if needed. * * @since 2.0.0 + * @since 4.4.0 X-Pingback header is added conditionally after posts have been queried in handle_404(). */ public function send_headers() { $headers = array(); @@ -582,6 +584,10 @@ class WP { * * Otherwise, issue a 200. * + * This sets headers after posts have been queried. handle_404() really means "handle status." + * By inspecting the result of querying posts, seemingly successful requests can be switched to + * a 404 so that canonical redirection logic can kick in. + * * @since 2.0.0 * * @global WP_Query $wp_query