I would wish to add a filter to _e() and __() functions. The filter is FilterTextOfEmail(). This will basically detect any emails and add anti-spam method to it.

I assume, the function for filtering should look like:

function my_wp_text_email_filtering ($content) {
    return FilterTextOfEmail($content)
}

But how to call it?

2 s
2

The filter name is gettext, and you would add it like this:

add_filter( 'gettext', 'my_wp_text_email_filtering', 10, 3 );

function my_wp_text_email_filtering( $translated, $text, $domain ) {
    return FilterTextOfEmail( $translated );
}

The $text argument is there also in case you want to access the pre-translated text.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *