Sorry to be a beginner in coding, but I need some further help. I’m using Contac Form 7 and I have a form with id=”720″ title=”Webgalamb próba”.
<p>Email cím (k?telez?)<br />
[email* your-email] </p>
[checkbox chechbox-123 "Hírlevél"]
<p>[submit "Küldés"]</p>
I only want to execute posting when [chechbox-123] is checked. Service name: Webgalamb1
Could you pls. modify tha code for me that is in FAQs?
add_filter('Forms3rdPartyIntegration_use_submission', 'f3i_conditional_submit', 10, 3);
function f3i_conditional_submit($use_this_form, $submission, $sid) {
// if there was a specific value -- skip
if(isset($submission['maybe-send']) && 'no' == $submission['maybe-send']) return false;
// if there was a specific value -- use
if(isset($submission['maybe-send']) && 'yes' == $submission['maybe-send']) return $use_this_form; // or true, i guess
// if there was a value for it (e.g. for checkboxes) -- skip
if(isset($submission['if-not-send'])) return false;
// if there was a value for it (e.g. for checkboxes) -- use
if(isset($submission['if-send']) && !empty($submission['if-send'])) return $use_this_form; // or true, i guess
return $use_this_form; // or <code>false</code>, depending on your desired default
}