zaus / forms-3rdparty-integration

Wordpress Plugin - Forms 3rdparty Integration - a plugin to help integrate 3rdparty services with common WP Forms plugins like Contact Form 7 and Gravity Forms
http://wordpress.org/plugins/forms-3rdparty-integration/
47 stars 14 forks source link

Submit boolean value #127

Open dkordic7 opened 1 year ago

dkordic7 commented 1 year ago

Hi there. Thank you for an amazing plugin which I've been using for years.

I'm trying to create a CF7 integration with Brevo (formerly Sendinblue) and one of their fields, updateEnabled, is of boolean type. Is there a way to set a static value of "true", but to lose the quotation marks in the submission request?

Thank you in advance!

dkordic7 commented 1 year ago

Looks like I found a working solution:

function updateEnabled($post, $service, $form, $sid){

foreach($post as $key => $value) if($key == "updateEnabled" && $value == "true") $post[$key] = true; return $post;

}

add_filter('Forms3rdPartyIntegration_service_filter_post_20', 'updateEnabled', 10, 4);