Skip to content

Instantly share code, notes, and snippets.

@rickrduncan
Created October 5, 2014 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickrduncan/356f5e35012321b717a5 to your computer and use it in GitHub Desktop.
Save rickrduncan/356f5e35012321b717a5 to your computer and use it in GitHub Desktop.
<?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