You are here

function recaptcha_v3_element_info_alter in reCAPTCHA v3 8

Same name and namespace in other branches
  1. 7 recaptcha_v3.module \recaptcha_v3_element_info_alter()

Implements hook_element_info_alter().

Place recaptcha v3 preprocess function at the beginning, so in this way it is possible to verify captcha and in case of fail, replace it by fallback captcha challenge.

Add one more process function to the end to display recaptcha_v3 error if happens.

File

./recaptcha_v3.module, line 63
Contains recaptcha_v3.module.

Code

function recaptcha_v3_element_info_alter(array &$info) {
  array_unshift($info['captcha']['#process'], 'recaptcha_v3_pre_captcha_element_process');
  $info['captcha']['#process'][] = 'recaptcha_v3_post_captcha_element_process';
}