Created
October 5, 2014 12:05
-
-
Save rickrduncan/356f5e35012321b717a5 to your computer and use it in GitHub Desktop.
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 | |
//* Do NOT include the opening php tag | |
//* Display email to screen WITHOUT href and scramble it to hide from spam bots | |
//* http://codex.wordpress.org/Function_Reference/is_email | |
//* http://codex.wordpress.org/Function_Reference/antispambot | |
function b3m_hide_email_shortcode( $atts, $content = null ) { | |
if ( ! is_email( $content ) ) { | |
return; | |
} | |
return antispambot( $content ); | |
} | |
add_shortcode( 'email', 'b3m_hide_email_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment