Created
June 27, 2014 23:03
-
-
Save iamcanadian1973/69ffd4f9928cb4b0774d to your computer and use it in GitHub Desktop.
Generate a safe HTML anchor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generates a safe email HTML anchor | |
* | |
* | |
* @access public | |
* @param string | |
* @return string | |
*/ | |
function safe_email($email = '' ){ | |
if( !$email ) { | |
$email = get_option('admin_email'); | |
} | |
if ( ! is_email( $email ) ) | |
return; | |
return '<a href="mailto:'.antispambot($email).'">'.antispambot($email).'</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment