Home › Forums › Calendar Products › Events Calendar PRO › Email obfuscation with Email Address Encoder?
- This topic has 4 replies, 2 voices, and was last updated 9 years, 2 months ago by Barry.
-
AuthorPosts
-
February 12, 2015 at 11:24 pm #942224AndersParticipant
Hi,
I guess it is considered polite not to open others threads, so I will just link to it here:
My question is the same as the original poster, but I am less smart, so I would need to know what exactly what I should drop in the functions-file?
If it helps: Here is the information from the Plugin FAQ:
How can I filter other parts of my site?
If the content supports WordPress filters, register the eae_encode_emails() function to it: add_filter($tag, ‘eae_encode_emails’);.
If the content is a PHP string, run it through the eae_encode_emails() function: $text = eae_encode_emails($text);.
If you want to encode a single email address, use the eae_encode_str() function: <?php echo eae_encode_str(‘[email protected]’); ?>This plugin doesn’t encode the entire website for performance reasons, it encodes only the content of the following WordPress filters the_content, the_excerpt, widget_text, comment_text, comment_excerpt.
February 12, 2015 at 11:25 pm #942225AndersParticipantSorry for that ugly formatting from the FAQ. Lets try this instead:
How can I filter other parts of my site?
If the content supports WordPress filters, register the eae_encode_emails() function to it: add_filter($tag, ‘eae_encode_emails’);.
If the content is a PHP string, run it through the eae_encode_emails() function: $text = eae_encode_emails($text);.
If you want to encode a single email address, use the eae_encode_str() function: <?php echo eae_encode_str(‘[email protected]’); ?>This plugin doesn’t encode the entire website for performance reasons, it encodes only the content of the following WordPress filters the_content, the_excerpt, widget_text, comment_text, comment_excerpt.
February 13, 2015 at 7:21 am #942297BarryMemberHi Anders,
So our support for customizations and integrations with other plugins is fairly limited (and I’m not in a position to test this out for you), but judging by the FAQ entries you copied in here it looks as though adding this very short snippet to your theme’s functions.php file would do the trick:
add_filter( 'tribe_get_organizer_email', 'eae_encode_emails' );
Could be worth a shot 🙂
February 13, 2015 at 9:18 am #942347AndersParticipantThanks Barry, I can confirm that the code actually works.
For anyone who might be reading this post:
While the Email Adress Encoder Plugin does exactly what it’s saying (obfuscating the email adress so Spam robots can’t read it) it does not automatically convert those email addresses to hyperlinked Mailto: links. (Wether that is a feature or not, depends on what you are looking for and your other considerations, like possible performance impact etc. )
For me, on this project, I needed a solution which also turned the plain email text into a mailto-link, so I ended up using the plugin WP Mailto Links, which does use JavaScript to protect the emailadresses, but does have a setting to convert plain text links to mailto links. If you make sure to check the whole body of the page it also works just fine with the organizer email and any other email addresses your clients might throw in there.
February 13, 2015 at 10:39 am #942385BarryMemberThanks for confirming Anders, I’m glad it worked (and thanks also for the added detail re WP Mailto Links).
I’ll go ahead and close out this topic – but of course please don’t hesitate to post fresh questions if any other issues arise 🙂
-
AuthorPosts
- The topic ‘Email obfuscation with Email Address Encoder?’ is closed to new replies.