/CF7 Honeypot Filter Recipes.php Secret
Created
February 4, 2016 16:13
Star
You must be signed in to star a gist
A collection of CF7 Honeypot filter examples for customizing the output of the CF7 Honeypot field.
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
// Customize Honeypot Message | |
function my_honeypot_message_override( $msg ) { | |
// Change the $msg value to your custom message text. | |
$msg = 'By filling in this field you may cause the universe to implode and your mom will be disappointed in you.'; | |
return $msg; | |
} | |
add_filter('wpcf7_honeypot_accessibility_message', 'my_honeypot_message_override', 10, 2 ); | |
// Customize Honeypot container CSS styles | |
function my_honeypot_css_override( $css ) { | |
// Change the $css value to your custom CSS to be applied to the honeypot's parent wrapper element. | |
$css = 'display:block; visibility:visible;'; | |
return $css; | |
} | |
add_filter('wpcf7_honeypot_container_css', 'my_honeypot_css_override', 10, 2 ); | |
// This filter allows you to modify the entire outputted HTML for the honeypot field. Use carefully. | |
function my_honeypot_html_override( $html, $args ) { | |
// You have access to both the default generated $html as well as the various $arg used to compile it. | |
return $html; | |
} | |
add_filter('wpcf7_honeypot_html_output', 'my_honeypot_html_override', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment