diff --git a/dapper.php b/dapper.php index 401ec4d..879a5f8 100644 --- a/dapper.php +++ b/dapper.php @@ -1207,6 +1207,48 @@ if ( class_exists( 'WPCF7' ) ) { + + + +

Quick check to help stop spam. Thanks!

+ '; + + // Insert after response div or before — aggressive match + $output = preg_replace( '/(
]*>.*?<\/div>)/is', '$1' . $checkbox_html, $output, 1 ); + + if ( strpos( $output, $checkbox_html ) === false ) { + $output = str_replace( '', $checkbox_html . '', $output ); + } + + if ( strpos( $output, $checkbox_html ) === false ) { + $output .= $checkbox_html; // Last resort append + dapper_debug_log( 'Universal CF7 fallback append used for shortcode/widget' ); + } + + dapper_debug_log( 'Universal CF7 insertion COMPLETE for shortcode' ); + + return $output; + } + + // 2. NEW: Visible checkbox — use reliable append method add_filter( 'wpcf7_form_elements', 'dapper_cf7_append_human_checkbox', 100 ); // Higher priority = later function dapper_cf7_append_human_checkbox( $form ) {