Before you start telling me there are already 10000000 posts on this error, I know.
I am working on a wordpress plugin and am recieving the following error when submitting my edit pages:
Warning: Cannot modify header information - headers already sent by (output started at ***\wp-content\plugins\***\meta-class-load.php:1067) in ***\wp-includes\pluggable.php on line 934
What’s different about this error is the line it references does not interface with the header, nor output content before. I have checked for whitespace surrounding php tags, and there is none 😛
This is the contents (and surrounds) of line 1067:
$name = $field['id'];
$type = $field['type'];
$old = $this->get_meta($post->ID, $field); // THIS IS THE LINE
$new = isset($_POST[$name]) ? $_POST[$name] : ($field['multiple'] ? array() : '');
Any ideas or solutions would be helpful. Thanks!
Never output anything before sending the
HEADER, if you do so you will not be able to send the header and it will throw an error !It’s also a good practice to set
error_reporting(0)on production server to make sure that no error gets shown beforeheader