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

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 15 15:35:57 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 sirzooro):

 When `header()` function is used in tested code, PHPUnit will report error
 in tests because of "Cannot modify header information - headers already
 sent" warning. Therefore `header()` function in tested code has to be
 either prefixed with `@` or stubbed. My patch allows to use the latter
 approach.

 Regarding pluggable functions - I can use another approach, e.g. call
 `wp_header` action from `wp_header()` function, and hook a function to it.

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


More information about the wp-trac mailing list