Not sure where to put the following hide email function in elements/hooks. wp_head seems to work but not sure if that is the best solution?
<?php
function remove_plaintext_email($emailAddress) {
$emailRegEx = '/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4})/i';
return preg_replace_callback($emailRegEx, "encodeEmail", $emailAddress);
}
function encodeEmail($result) {
return antispambot($result[1]);
}
add_filter( 'the_content', 'remove_plaintext_email', 20 );
add_filter( 'widget_text', 'remove_plaintext_email', 20 );
?>