gglcptch_recaptcha_check

The Google Captcha (reCAPTCHA) by BestWebSoft gglcptch recaptcha check function.

Description

gglcptch_recaptcha_check( (bool) $allow = true ); 

Parameters (1)

0. $allow — Optional. (bool) => true
The allow.

Usage

  1. if ( !function_exists( 'gglcptch_recaptcha_check' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-captcha-recaptcha-by-bestwebsoft/google-captcha.php'; 
  3.  
  4. // The allow. 
  5. $allow = true; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gglcptch_recaptcha_check($allow); 
  9.  

Defined (1)

The function is defined in the following location(s).

/google-captcha.php  
  1. function gglcptch_recaptcha_check( $allow = true ) { 
  2.  
  3. if ( ! $allow || is_string( $allow ) || is_wp_error( $allow ) ) { 
  4. return $allow; 
  5.  
  6. $result = gglcptch_check(); 
  7.  
  8. if ( $result['response'] || $result['reason'] == 'ERROR_NO_KEYS' ) 
  9. return true; 
  10.  
  11. $error_message = sprintf( '<strong>%s</strong>: %s', __( 'Error', 'google-captcha' ), gglcptch_get_message() ); 
  12. /** 
  13. * Function 'cntctfrm_handle_captcha_filters' was added in Contact Form 4.0.2 (Free and Pro) 
  14. * remove this condition. WP_Error is correct object for return. 
  15. * @deprecated since 1.26 
  16. * @todo remove after 01.08.2017 
  17. */ 
  18. if ( function_exists( 'cntctfrm_handle_captcha_filters' ) ) { 
  19. $allow = new WP_Error(); 
  20. $allow->add( 'gglcptch_error', $error_message ); 
  21. } else { 
  22. $allow = $error_message; 
  23. return $allow;