• I have run a code like this:

    add_filter('gettext', 'my_test_123', 20, 3);
    function my_test_123($translated_text, $text, $domain){
        if ( $domain == 'domain' ) {
            if($text == 'from text') {
                $translated_text = 'to text';
            }
        }
        return $translated_text;
    }

    It seems there is no way around to get rid of the previous code, it inserts one or more rows into wp_trp_gettext_en_us table. I can remove them using $wpdb to fix the issue but I can’t find a hook to remove the work of the previous filter.
    Am I missing something?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    By default, the gettext filter does not add anything to any table. WP does not even have a table like you describe. I think it’s the work of your multilingual plugin. I recommend asking its devs for advice through their dedicated support channel.

    Thread Starter farhan25

    (@farhan25)

    @bcworkz
    Thanks a lot for your time.
    It seems as you said, the plugin TranslatePress.
    I just want to make sure that I can use add_filter with gettext without any dependency and without DB conflict, in case I want to remove it in the future.
    Is that possible ?
    Thank you again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add_filter gettext is irreversible’ is closed to new replies.