Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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