How to add filter to __() and _e()?

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)