Skip to content

Instantly share code, notes, and snippets.

@corsonr
Created September 18, 2012 15:16
Show Gist options
  • Select an option

  • Save corsonr/3743701 to your computer and use it in GitHub Desktop.

Select an option

Save corsonr/3743701 to your computer and use it in GitHub Desktop.
secure email shortcode
<?php
/* ------------------------------------------------------------------*/
/* SECURE EMAIL SHORTCODE */
/* ------------------------------------------------------------------*/
function xxx_secure_mail( $atts ) {
extract(
shortcode_atts( array(
"mailto" => '',
"txt" => ''
), $atts)
);
$mailto = antispambot( $mailto );
$txt = antispambot( $txt );
return '<a href="mailto:' . $mailto . '">' . $txt . '</a>';
}
if ( function_exists('add_shortcode') )
add_shortcode('email', 'xxx_secure_mail');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment