• Resolved kender

    (@kender)


    I would like to convert my CF7 “select – multiple” to output a csv into the PDF textarea box

    i don’t mind doing this as a function, or using the PDF interface to do it, but i don’t see any direction on this

Viewing 1 replies (of 1 total)
  • Thread Starter kender

    (@kender)

    I was able to do this with this code block

    // convert cf7 multi to csv for email
    add_filter('wpcf7_posted_data', function($data) {
    // List the CF7 field names you want to convert
    $fields_to_csv = [
    'field-name', // for [select states id:states multi "options"] - enter 'states'
    ];

    foreach ($fields_to_csv as $field) {
    if (!empty($data[$field]) && is_array($data[$field])) {
    $data[$field] = implode(', ', $data[$field]);
    }
    }

    return $data;
    });
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.