gglcptch_login_check

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

Description

gglcptch_login_check( $user ); 

Parameters (1)

0. $user
The user.

Usage

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

Defined (1)

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

/google-captcha.php  
  1. function gglcptch_login_check( $user ) { 
  2.  
  3. $result = gglcptch_check(); 
  4.  
  5. if ( ! $result['response'] ) { 
  6. if ( $result['reason'] == 'ERROR_NO_KEYS' ) { 
  7. return $user; 
  8.  
  9. $error_message = sprintf( '<strong>%s</strong>: %s', __( 'Error', 'google-captcha' ), gglcptch_get_message() ); 
  10.  
  11. if ( $result['reason'] == 'VERIFICATION_FAILED' ) { 
  12. wp_clear_auth_cookie(); 
  13. return new WP_Error( 'gglcptch_error', $error_message ); 
  14.  
  15. if ( isset( $_REQUEST['log'] ) && isset( $_REQUEST['pwd'] ) ) { 
  16. return new WP_Error( 'gglcptch_error', $error_message ); 
  17. } else { 
  18. return $user; 
  19. } else { 
  20. return $user;