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

WordPress Trac noreply at wordpress.org
Fri Mar 5 18:02:14 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:  General            |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------
Changes (by hellofromTonya):

 * keywords:  dev-feedback => reporter-feedback


Comment:

 Hello @mitfi,

 Welcome to WordPress Core Trac. Thank you for your ticket!

 >However, a call to mfem-warning-saltsform-handler-pre, with some activity
 done there (regardless whether I do a screen output or not) and a redirect
 to "admin.php?page=mfem-emergency-management", will fail with the above
 warning as soon as the redirect is executed.

 - Can you share the redirect code in the
 `mfem_warning_saltsform_handler_pre` callback?

 I attempted to reproduce the problem using the code in the description as
 well as adding this redirect in that callback:

 {{{#!php
 <?php
 function mfem_warning_saltsform_handler_pre() {
         wp_redirect( admin_url( 'users.php?page=mfem-emergency-management'
 ) );
 }
 }}}


 Navigating to the sub page, the `Warning: Cannot modify header
 information` appeared on both WP 5.6.2 and 5.7 RC2.

 - Also, can you share the enter warning back grabbing a screenshot?
 Why? The callstack in the PHP warning information can help with further
 investigation.

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


More information about the wp-trac mailing list