is_active() ) { wpcf7_add_form_tag( 'recaptcha', 'astoundify_recaptcha_wpcf7_form_tag_handler', array( 'display-block' => true, ) ); } } add_action( 'wpcf7_init', 'astoundify_recaptcha_wpcf7_add_form_tag' ); /** * Recaptcha Form Tag Handler * * @since 1.0.0 * * @param array $tag CF7 Tags. * @return string */ function astoundify_recaptcha_wpcf7_form_tag_handler( $tag ) { $options = array(); // Theme: $theme = $tag->get_option( 'theme', '(dark|light)', true ); if ( $theme ) { $options['theme'] = $theme; } // Size: $size = $tag->get_option( 'size', '(normal|compact)', true ); if ( $size ) { $options['size'] = $size; } return astoundify_recaptcha_field( false, 'wpcf7', $options ); }