Last active
January 22, 2017 13:17
-
-
Save websupporter/60ff0264e62aa9e3ca4deeb687ac6f6b to your computer and use it in GitHub Desktop.
Shortcode for my antispambot blogpost http://websupporter.net/blog/de/verschleiere-deine-mailadresse-mit-antispambot
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
<?php | |
function wpcodex_hide_email_shortcode( $atts , $content = null ) { | |
if ( ! is_email( $content ) ) { | |
return; | |
} | |
return '<a href="mailto:' . antispambot( $content ) . '">' . antispambot( $content ) . '</a>'; | |
} | |
add_shortcode( 'email', 'wpcodex_hide_email_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment