Skip to content

s2_captcha_element

  • Subscribe2
  • Updated Nov 23, 2023
  • 1 min read

Introduced in Version 11, this filter allows adjustments to be made to the display of the ReCaptcha form element if needed.

function align_captcha_left( $element, $site_key, $shortcode_args ) {
// Below code amends badge to compact size of form is from Widget
if ( 'true' === $shortcode_args['widget'] ) {
$element = str_replace( 'data-sitekey=', 'data-size="compact" data-sitekey=', $element );
}
return $element;
}
add_filter( 's2_captcha_element', 'align_captcha_left', 10, 3 );

Last updated on

Filed under Hooks, API & Customization

Still stuck?

Our support team can walk you through it.