I try to change your code from:
<div class="captcha-image">
<p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
<?php
$i = -1;
foreach($choices as $title => $image) {
$i++;
if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
echo '<label><input type="radio" name="kc_captcha" value="'. $value .'"/><i class="fa '. $image .'"></i></label>';
}
?>
<!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
</div>
to
<div id="captcha" class="captcha-image">
<p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
<span class="wpcf7-form-control-wrap checkbox kc_captcha">
<span clas="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
<?php
$i = -1;
foreach($choices as $title => $image) {
$i++;
if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
echo '<span class="wpcf7-list-item"><label><input type="radio" name="kc_captcha" value="'. $value .'"><i class="fa '. $image .' wpcf7-list-item-label"></i></label></span>';
}
?>
</span>
</span>
<!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
</div>
but CF7 doesn’t show the error messagge…
…something in my code is wrgon, …sorry 😛
But I hope help you! 🙂
Ok,
I DID IT! 😀
I changed your code from:
<div class="captcha-image">
<p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
<?php
$i = -1;
foreach($choices as $title => $image) {
$i++;
if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
echo '<label><input type="radio" name="kc_captcha" value="'. $value .'"/><i class="fa '. $image .'"></i></label>';
}
?>
<!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
</div>
to
<div class="captcha-image">
<p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
<?php
$i = -1;
foreach($choices as $title => $image) {
$i++;
if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
echo '<label><input type="radio" name="kc_captcha" value="'. $value .'"/><i class="fa '. $image .'"></i></label>';
}
if($_POST['cf7ic_exists']) {
if(!empty($_POST['kc_honeypot']) || $_POST['required'] != "kc_human") {
printf('<span class="wpcf7-not-valid-tip" role="alert">__('HERE YOUR ERROR MESSAGGE');</span>');
}
}
?>
<!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
</div>
Thank you for your contribution, I’ll work on getting the validation notification to work correctly.