Title: Doesn&#039;t work in custom fields?
Last modified: August 21, 2016

---

# Doesn't work in custom fields?

 *  Resolved [la_ri_za](https://wordpress.org/support/users/la_ri_za/)
 * (@la_ri_za)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/doesnt-work-in-custom-fields/)
 * Hi,
 * thanks for the great plugin! I’ve been using it for quite a long time now, but
   today I noticed that it (version 0.8) doesn’t work in my custom fields content.
   I’d swear that it worked before. I wonder what has happened? Should it work with
   custom fields?
 * [http://wordpress.org/plugins/email-encoder-bundle/](http://wordpress.org/plugins/email-encoder-bundle/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [bridgetwes](https://wordpress.org/support/users/bridgetwes/)
 * (@bridgetwes)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/doesnt-work-in-custom-fields/#post-3997013)
 * I also needed this and found the following in the help tab (drop down at top 
   of Email Encoder Bundle admin page):
 * Encode the given email (other params are optional):
    <?php echo encode_email(
   $email, [$display], [$method], [$extra_attrs]); ?>
 * Encode the given content for emails to encode (other param is optional):
    <?php
   echo encode_content($content, [$method]); ?>
 * If you are spitting out a custom field in a template, one of the above two methods
   should work to encode the email.
 *  [Pi Zi](https://wordpress.org/support/users/freelancephp/)
 * (@freelancephp)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/doesnt-work-in-custom-fields/#post-3997014)
 * Exactly, this can be solved by using the template function.
    I will add it to
   the FAQ.
 * Thanks Lariza and Bridget!
 *  [masspamak](https://wordpress.org/support/users/masspamak/)
 * (@masspamak)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/doesnt-work-in-custom-fields/#post-3997028)
 * Hello, i switched to your plugin recently also because I’ve think this thread
   would definitively fix my problem but I did not get it working in a specific 
   case, i haver the following code in my template and would like to encode the 
   email address, i can get it working when i call the encoding in plain text
 *     ```
       Send a email to <strong><?php $emailforrequest = get_post_meta($post->ID, 'emailforrequest', TRUE);
       echo eeb_email($emailforrequest, 'the support team'); ?></strong> to get help.
       ```
   
 * this is ok ! But if i try to insert it in my “mailto” template as the following
   example it does not works.
 * `<a title=click here to open the email" href="mailto:<?php the_field('emailforrequest');?
   >?subject=the subject line&Body=my body content that may call other php function
   such as <?php the_title(); ?>"><img class="imgclass" title="imgtitle" alt="imgalt"
   src="imgsource.png" width="240" height="24" /></a>`
 * at this point i replaced
 * `<?php the_field('emailforrequest'); ?>`
 * with
 *     ```
       <?php $emailforrequest = get_post_meta($post->ID, 'emailforrequest', TRUE);
       echo eeb_email($emailforrequest, 'Mail Me'); ?>
       ```
   
 * but it does not works at all.
 * I’ve followed your FAQ and tips but cannot get it working, also i did not found
   the way to generate a mailto template to with PHP, it may works better as i could
   call each element (email, subject and body) with single PHP string and avoid 
   to broke the encoding function.
 * Many thanks for your help
 *  [Pi Zi](https://wordpress.org/support/users/freelancephp/)
 * (@freelancephp)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/doesnt-work-in-custom-fields/#post-3997030)
 * You have to encode the whole mailto link. This should work:
 *     ```
       $mailto = '<a title="click here to open the email" href="mailto:' . get_field('emailforrequest') . '?subject=the subject line&Body=my body content that may call other php function such as ' . get_the_title() . '"><img class="imgclass" title="imgtitle" alt="imgalt" src="imgsource.png" width="240" height="24" /></a>';
   
       echo eeb_email_filter($mailto);
       ```
   
 *  [masspamak](https://wordpress.org/support/users/masspamak/)
 * (@masspamak)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/doesnt-work-in-custom-fields/#post-3997031)
 * Nice! It seems to work well and fit my -encoding- needs!
 * I still have a problem with the ‘ sign used in the Email template that broke 
   the php code (you know those ” and ‘ around) but i will find the way to get it
   working.
 * My last question would be: a bot or spambot could get or use this mailto linked
   image to spam around?
 * Actually my mailto image is hidden in a DIV that user have to unhide by clicking
   a #link, but i would like to avoid this user action by having the mailto image
   available to users as soon they land on my page (visitors only and not bot, of
   course).
 * Many thanks for your support and for this plugin that really works.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Doesn't work in custom fields?’ is closed to new replies.

 * ![](https://ps.w.org/email-encoder-bundle/assets/icon-256x256.png?rev=2056506)
 * [Email Encoder - Protect Email Addresses and Phone Numbers](https://wordpress.org/plugins/email-encoder-bundle/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-encoder-bundle/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-encoder-bundle/)
 * [Active Topics](https://wordpress.org/support/plugin/email-encoder-bundle/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-encoder-bundle/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-encoder-bundle/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [masspamak](https://wordpress.org/support/users/masspamak/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/doesnt-work-in-custom-fields/#post-3997031)
 * Status: resolved