Skip to content

Instantly share code, notes, and snippets.

@jchamb
Created April 15, 2015 15:58
Show Gist options
  • Save jchamb/933dc7572e9e87aad450 to your computer and use it in GitHub Desktop.
Save jchamb/933dc7572e9e87aad450 to your computer and use it in GitHub Desktop.
Fix for CF7 add_uploaded_file
public function add_uploaded_file( $name, $file_path ) {
$mail = $this->contact_form->prop('mail');
$this->uploaded_files[$name] = $file_path;
if ( empty( $this->posted_data[$name] ) ) {
$this->posted_data[$name] = basename( $file_path );
$mail['attachments'] .= "[$name]\n";
$this->form->set_properties( array('mail' => $mail) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment