Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.