Support » Miscellaneous » [Resolved] Antispambot and admin_email question

[Resolved] Antispambot and admin_email question

  • Hi All,

    I am currently writing a theme and wanted to make it the best it can be. I am writing the 404 error page, and want to include a link to email the webmaster. I was wondering if it is possible to run the bloginfo(‘admin_email’) through antispambot in something like this? :

    mailto:<?php antispambot(bloginfo(‘admin_email’)); ?>

    Is that possible or is it just wishful thinking?

    Any help would be much appreciated.
    Many Thanks,

Viewing 9 replies - 1 through 9 (of 9 total)
  • What I think you’re missing is the echo. See this thread:

    OK. So would:

    mailto:<?php echo antispambot(bloginfo(‘admin_email’)); ?>

    work? I just didn’t think that you would be able to nest the bloginfo command…?

    Or would I need:

    mailto:<?php echo antispambot(bloginfo(‘admin_email);); ?>



    mailto:<?php echo antispambot(get_bloginfo('admin_email')); ?>

    No: that just returns mailto:~this is blank~

    Any other suggestions?

    I have tried the antispambot(bloginfo('admin_email')); too, but that doesn’t encode the address, just returns it in plain text.`

    …but that doesn’t encode the address, just returns it in plain text.

    Because bloginfo() cannot be used the way you’re trying to use it; it only *echoes* output and doesn’t return it back to your code. The one I suggested, get_bloginfo(), does exactly what bloginfo() does, only it returns any output. If that returned value happens to be empty, then something else is amiss.

    WHat could cause this?

    Well, usually something missing in some part of the code. As a test, what do just:

    <?php bloginfo('admin_email'); ?>


    <?php echo get_bloginfo('admin_email'); ?>


    Hi There,

    I am so sorry.. I missed out the echo (Doh!)

    Many Thanks for all your help, with the echo it all works fine now!

    Many Thanks again,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Antispambot and admin_email question’ is closed to new replies.