title: wordpress wp_redirect not working
body: <p>Hello i have a frontend form with file uploading and after submission wp_redirect, nor header() are working.</p>
  
  <pre><code>&lt;?php if( 'POST' == $_SERVER['REQUEST_METHOD'] ) { // if form has been submitted
  update_field('field_2', $title, $postID);
  update_field('field_3', $efternamn, $postID);
  update_field('field_4', $epost, $postID);
  update_field('field_6', $telefon, $postID);
  update_field('field_7', $motiv, $postID);
  if (!function_exists('wp_generate_attachment_metadata')){
  require_once(ABSPATH . "wp-admin" . '/includes/image.php');
  require_once(ABSPATH . "wp-admin" . '/includes/file.php');
  require_once(ABSPATH . "wp-admin" . '/includes/media.php');
  }
  if ($_FILES) {
  foreach ($_FILES as $file =&gt; $array) {
  if ($_FILES[$file]['error'] !== UPLOAD_ERR_OK) {
  return "upload error : " . $_FILES[$file]['error'];
  }
  $attach_id = media_handle_upload( $file, $postID );
  }
  }
  //if ($attach_id &gt; 0){
  //and if you want to set that image as Post then use:
  //update_post_meta($postID,'_thumbnail_id',$attach_id);
  //}
  update_field('field_5', $attach_id, $postID);
  $dialog_url='http://tatchit.com';
  wp_redirect(home_url());
  }
  ?&gt;
  </code></pre>
  
  <p>any suggestions?</p>