WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#43257 closed defect (bug) (invalid)

wp_redirect() throws error "Cannot modify header information"

Reported by: thamaraiselvam Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.4
Component: General Keywords:
Focuses: administration, template Cc:

Description

When I try to

wp_redirect( $url );

it does not redirect and throws following error.

PHP Warning: Cannot modify header information - headers already sent by (output started at /home/accuhomeinspecti/public_html/wp-admin/includes/template.php:2041) in /home/accuhomeinspecti/public_html/wp-includes/pluggable.php on  line 1216

This admin class printing throws error : wp-admin/includes/template.php

<?php

<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php

Browser:
Version 62.0.3202.94 (Official Build) (64-bit)

PHP
7.1 + Nginx

Change History (2)

#1 @soulseekah
4 years ago

  • Resolution set to invalid
  • Status changed from new to closed

This is definitely not a bug in core. See https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php for possible explanations, solutions.

#2 @swissspidy
4 years ago

  • Milestone Awaiting Review deleted

Agreed. A plugin or theme you're using is doing_it_wrong.

Note: See TracTickets for help on using tickets.