The WordPress Codex offers an interesting snippet for a shortcode. First copy the following code into the functions.php
of the theme or use WP Code Box:
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' );
Subsequently, an email address can be linked and encoded via the shortcode. The use in the WordPress editor looks like this, for example:
[email][email protected][/email]