• Resolved GermanKiwi

    (@germankiwi)


    Hi, I’m using Widget Blocks on my site to create a couple of widgets in my footer area, which contain ‘mailto’ email links.

    I’m also using the Email Address Encoder plugin which encodes email addresses in posts and pages into decimal and hexadecimal entities, in order to protect them from being harvested by spambots.

    However, that plugin isn’t able to directly filter and encode email addresses that appear in widgets (apart from the standard Text Widget).

    Fortunately that plugin does provide a filter which can be used to encode the email addresses in such widgets, using an “add_filter” command which I believe would go into the functions.php file. This is explained on the FAQ page of that plugin: http://wordpress.org/plugins/email-address-encoder/faq/

    So my question here is: does Widget Blocks support WordPress filters as described on that FAQ page, such that I could use the filter to encode email addresses in the widgets?

    If so, would you be able to help me figure out how to write such a filter, which I could put in my functions.php? I think all the relevant info is on the FAQ page of the other plugin.

    Thanks!

    http://wordpress.org/plugins/wysiwyg-widgets/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi there,

    Sure, add the following code to your theme its functions.php file.

    add_filter('ww_content',  'eae_encode_emails');

    Hope that helps!

    Thread Starter GermanKiwi

    (@germankiwi)

    Thanks for the quick reply – that code works perfectly!! 🙂

    One question though, should I specify any priority in this ‘add_filter’ command?

    At http://wordpress.org/plugins/email-address-encoder/faq/ it says that “the default filter priorty is 1000”. I’m not sure if that default priority applies to a filter I’ve created myself like this one?

    Plugin Author Danny van Kooten

    (@dvankooten)

    The default WordPress filter priority is 10, if it’s not specified in the add_filter function call.

    If you want the Email Address Encoder function to run really late and most likely after all other filters, use the following code.

    add_filter('ww_content',  'eae_encode_emails', 1000);

    Hope that helps!

    Thread Starter GermanKiwi

    (@germankiwi)

    Okay. And you think that would be the correct thing to do based on the info on that FAQ page about priorities?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filtering the content of this plugin’ is closed to new replies.