[wp-trac] [WordPress Trac] #21282: Introduce wp_header() pluggable function

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 26 15:46:20 UTC 2012


#21282: Introduce wp_header() pluggable function
-----------------------------------+------------------------------
 Reporter:  sirzooro               |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  General                |     Version:  3.4.1
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------------------

Comment (by bpetty):

 As this patch stands right now, it will silence any errors with production
 site code sending back headers, not just unit tests, so I don't think this
 should be applied as is.

 At least in all the situations that involve redirect headers, those
 *should* be calling `wp_redirect()`, and `wp_redirect()` is also already
 unit testable. So any `header()` calls used for redirect should be changed
 to use that, especially since plugins using filters on redirects are
 expecting WordPress to use that call before any redirect.

 I'm still not sure how to handle anywhere else that uses any other type of
 header though, but I also don't think there's one blanket solution for
 every method that calls `header()`. In many cases, those are the primary
 functionality of those functions, and they need to be tested that the
 headers are correctly generated (even if they aren't sent).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21282#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list