Add securimage captcha to PODS.io front form
-
/*
This add captcha to pods.io front form
*/add_action( ‘pods_form_after_fields’, ‘slug_captcha’ );
function slug_captcha(){
print’
<div class=”pods-field-label”>
<label class=”pods-form-ui-label pods-form-ui-label-pods-field-captcha” for=”pods-form-ui-pods-field-captcha”>
CAPTCHA</label>
</div>
<div class=”pods-field-input”>’.do_shortcode(‘[siwp_show_captcha]’).'</div><style>
.pods-form-front .pods-submit {
float: right;
margin-top:250px;
}
</style>
‘;
}
add_filter( ‘wp_insert_post_empty_content’ , ‘verify_captcha’ , 99, 2 );
function verify_captcha($maybe_empty, $postarr){if(!$_SERVER[‘REQUEST_METHOD’] == ‘POST’){
return $maybe_empty;// retourne la valeur d’origine si pas de captcha
}else{
if (function_exists(‘siwp_check_captcha’)&&isset($_POST[‘siwp_captcha_value’])) {// make sure plugin is enabled before calling function
if (false == siwp_check_captcha($err)) {
return true;
}
}
}
}/*
L’erreur empty_content retourne : Error: Le contenu, le titre et l’extrait sont vides.
Il faut éditer la traduction FR pour compléter avec : Captcha error.PS
Dommage qu’on ne puisse pas ajouter directement un filtre dans post.php>wp_insert_post à l’instar de wp_insert_post_empty_content
*/The page I need help with: [log in to see the link]
- The topic ‘Add securimage captcha to PODS.io front form’ is closed to new replies.