Bypass captcha in Bricks Forms for automated testing and monitoring

Hello Fellow Bricklayers.

As part of a recurring testing of the web site to ensure that all functionality works, we need to test form submission in certain pages. To do so, we would need to bypass captcha (currently we are using the hcaptcha integration).

Our idea is to pass some sort of a query string in the URL that in PHP we would somehow disable the captcha or otherwise on a callback of sorts, let the form submission continue even if captcha fails. A hook into the captcha callback would be amazing but alas I am having a hard time finding docs on this.

Any ideas, suggestions or solutions are greatly appreciated.

Thank you.

T.

You could use this filter to programmatically remove hcaptcha from all forms for certain users:

add_filter( 'bricks/element/settings', function( $settings, $element ) {   
 if ( $element->name === 'form' && current_user_can('manage_options') {        
         //Your Logic here
  }
return $settings;
}, 10, 2 );

just var_dump the $settings and unset() all hcaptcha related settings. That should do the trick imo.

Best Regards
Suat

Thank you! I will give this a shot this coming week and feedback here.