WhiteList IP not working as expected
-
We are using following code to whitelist specific IP’s while submitting ninja forms in one of our clients site.
/** * Filter user IP to check if it is whitelisted. * For whitelisted IPs, hCaptcha will not be shown. * * @param bool $whitelisted Whether IP is whitelisted. * @param string $ip IP. * * @return bool */ function my_hcap_whitelist_ip( $whitelisted, $ip ) { // Whitelist local IPs. if ( false === $ip ) { return true; } // Whitelist some other IPs. if ( '1.1.1.1' === $ip ) { return true; } return $whitelisted; } add_filter( 'hcap_whitelist_ip', 'my_hcap_whitelist_ip', 10, 2 );
Issue is that, this code does not hide hCaptcha from the from but just allows the submission without attempting it. ( Form submits without any issues even if you don’t attempt hCaptcha ).
We want it to be hidden as it actually gets hidden when we add IP address manually in the whitelist settings field.
Thanks!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.