Contact Fom 7 - how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control ? Using the 'Query Monitor' plugin I found that the HOOK which I need to modify is inside the:

'/wp-content/plugins/contact-form-7/modules/text.php' file, namely 'wpcf7_add_form_tag_text' hook

My attepmt is:

function test($html) {

$html = sprintf(
'<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s<span class="focus-input100-1"></span><span class="focus-input100-2"></span></span>',
sanitize_html_class( $tag->name ), $atts, $validation_error );
return $html;

add_filter('wpcf7_add_form_tag_text', 'test');

...but it does not work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.