[wp-trac] [WordPress Trac] #52725: WP5.7-RC2-50494 Warning: Cannot modify header information

WordPress Trac noreply at wordpress.org
Sat Mar 6 01:33:46 UTC 2021


#52725: WP5.7-RC2-50494 Warning: Cannot modify header information
-------------------------------+------------------------------
 Reporter:  mitfi              |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Administration     |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------

Comment (by mitfi):

 Replying to [comment:4 SergeyBiryukov]:

 Dear @SergeyBiryukov,

 as stated already, my code works with 5.6.2.
 There is no willingly output generated prior redirect in this case.
 On the other side, with a start from my main admin page, which obviously
 has an output, a redirect back to itself is not generating any issue.

 Please allow one remark: you all are doing a great job, providing such a
 wonderful environment for generating online sites.
 Thanks for all your efforts!

 Best regards

 Michael


 > > `Warning: Cannot modify header information - headers already sent by
 (output started at /.../wp-admin/includes/template.php:2526) in /.../wp-
 includes/pluggable.php on line 1329`
 > > `Warning: Cannot modify header information - headers already sent by
 (output started at /.../wp-admin/includes/template.php:2526) in /.../wp-
 includes/pluggable.php on line 1332`
 >
 > Just noting that these warnings are caused by calling `wp_redirect()`
 after the output has already started from the `_wp_admin_html_begin()`
 function.
 >
 > As noted above, this does not seems specific to WordPress 5.7. A
 solution would be to perform the redirects as soon as possible, before any
 output.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52725#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list