gglcptch_check_role

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

Description

gglcptch_check_role(); 

Usage

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

Defined (1)

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

/google-captcha.php  
  1. function gglcptch_check_role() { 
  2. global $current_user, $gglcptch_options; 
  3.  
  4. if ( ! is_user_logged_in() ) 
  5. return false; 
  6.  
  7. if ( ! empty( $current_user->roles[0] ) ) { 
  8. $role = $current_user->roles[0]; 
  9. if ( empty( $gglcptch_options ) ) 
  10. return isset( $gglcptch_options[ $role ] ) && '1' == $gglcptch_options[ $role ] ? true : false; 
  11. } else 
  12. return false;