Skip to content

Instantly share code, notes, and snippets.

@websupporter
Last active January 22, 2017 13:17
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 websupporter/60ff0264e62aa9e3ca4deeb687ac6f6b to your computer and use it in GitHub Desktop.
Save websupporter/60ff0264e62aa9e3ca4deeb687ac6f6b to your computer and use it in GitHub Desktop.
<?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