';
$field_error .= __( 'Please solve the captcha to proof that you are human.', 'affiliates-captcha' );
$field_error .= '';
}
$field .= '
';
$field .= '';
$field .= '
';
$field .= apply_filters( 'affiliates_captcha_field_error', $field_error );
}
return $field;
}
/**
* Validates the captcha.
*
* @param boolean $result
* @param string $field_value
* @return boolean
*/
public static function affiliates_captcha_validate( $result, $field_value ) {
global $affiliates_captcha_error;
$result = true;
if ( function_exists( 'cptch_check_custom_form' ) ) {
$result = ( cptch_check_custom_form() === true );
}
if ( !$result ) {
$affiliates_captcha_error = true;
}
return $result;
}
}
add_action( 'init', array( 'Affiliates_Captcha', 'init' ) );