We managed to get it done with gform_confirmation.
Check it out here (until late July 2013 when contest ends)
http://skypestaytogether.com/contest-entry/
add_filter("gform_confirmation", "custom_confirmation", 10, 4);
function custom_confirmation($confirmation, $form, $lead, $ajax){
$gfe = $lead['id'];
$storyTitle=$lead['4'];
$storyBody=$lead['2'];
$body = $storyBody." ".$storyTitle;
if (($form["id"] == "3")|| ($form["id"] == "5")){
if (containsProfanity($body)){
$confirmation = array('redirect' => home_url().'/thank-you');
changePostToDraft($lead);
$confirmation = array('redirect' => home_url().'/review-entry/?e='.$gfe);
} else {
$confirmation = array('redirect' => home_url().'/thank-you');
}
return $confirmation;
}
}
function containsProfanity($text){
//our check went here
}
Posted 11 years ago on Wednesday June 26, 2013 |
Permalink