Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cf7_attachment_link($wpcf7) {
- $submission = WPCF7_Submission::get_instance();
- if ($submission) {
- $uploaded_files = $submission->uploaded_files();
- if (!empty($uploaded_files)) {
- $attachments = array();
- foreach ($uploaded_files as $fieldname => $uploaded_file) {
- $attachments[] = $uploaded_file;
- }
- $mail = $wpcf7->prop('mail');
- $mail['attachments'] = $attachments;
- $wpcf7->set_properties(array('mail' => $mail));
- }
- }
- }
- add_action('wpcf7_before_send_mail', 'cf7_attachment_link');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement