Home / Admin / Sending Multiple File Uploads to Google Drive through Zapier
Duplicate Snippet

Embed Snippet on Your Site

Sending Multiple File Uploads to Google Drive through Zapier

This snippet modifies our Zapier integration and allows users to send multple files submitted through the file upload field to Google Drive.

<10
Code Preview
php
<?php
/**
 * Send multiple files to Google Drive with Zapier addon
 *
 * @link https://wpforms.com/developers/how-to-send-multiple-files-to-google-drive-with-zapier/
 */
 
function wpf_dev_add_zapier_file_upload_filter($data, $entry_id, $form_data) {
 
    $fields = wpforms_get_form_fields( $form_data );
    foreach ( $fields as $field_id => $field ) {
        if ( $field['type'] === 'file-upload' ) {
            $data[ 'field'.$field_id ] = explode( "\n", stripslashes( $data[ 'field'.$field_id ] ) );
        }
    }
 
    return $data;
}
add_filter('wpforms_zapier_process_entry_data', 'wpf_dev_add_zapier_file_upload_filter', 10, 3);

Comments

Add a Comment