Created
April 9, 2014 15:44
-
-
Save hweeks/10284705 to your computer and use it in GitHub Desktop.
WordPress Email Encoder using ACF
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
//Your html code snippet | |
<?php echo(encode_email(get_field('variable-you-choose')));?> | |
//Your Functions file add on | |
function encode_email($e) { | |
$output = ""; | |
for ($i = 0; $i < strlen($e); $i++) { $output .= '&#'.ord($e[$i]).';'; } | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment