Created
February 4, 2020 11:41
-
-
Save mrsize/1acf463bf05e65437293aafa17ffd884 to your computer and use it in GitHub Desktop.
CF7 Antispam Hide Honeypot Field Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wp1561_cf7_antispam_hide_honeypot_field() { | |
global $post; | |
if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'contact-form-7') ) { | |
echo "<style>.honeypotField{display:none;}</style>"; | |
} | |
} | |
add_action( 'wp_head', 'wp1561_cf7_antispam_hide_honeypot_field' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment