Skip to content

Instantly share code, notes, and snippets.

@norcross
Created October 1, 2012 15:37
Show Gist options
  • Save norcross/3812557 to your computer and use it in GitHub Desktop.
Save norcross/3812557 to your computer and use it in GitHub Desktop.
Obfuscate email shortcode
/*
Usage (on the HTML tab, not the visual editor)
[email address="[email protected]"]
*/
function emailbot_ssc($attr) {
extract( shortcode_atts( array(
'address' => '',
), $attr ) );
$email = '<a class="email_link" href="mailto:'.antispambot($attr['address']).'" title="Send Us An Email" target="_blank">';
$email .= antispambot($attr['address']);
$email .= '</a>';
return $email;
}
add_shortcode('email', 'emailbot_ssc');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment