HEX
Server: LiteSpeed
System: Linux cpir1.prohostdns.com 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: pelakir (2976)
PHP: 8.2.31
Disabled: exec, shell_exec, system, passthru, proc_open, proc_close, proc_terminate, proc_get_status, popen, pclose, pcntl_exec
Upload Files
File: //home/pelakir/www/wp-content/plugins/digits/includes/core/translate.php
<?php


if (!defined('ABSPATH')) {
    exit;
}

DigitsTranslate::instance();

final class DigitsTranslate
{
    protected static $_instance = null;
    private $replaceOTPWith = false;

    public function __construct()
    {
        add_action('wp_loaded', [$this, 'init']);
    }

    /**
     *  Constructor.
     */
    public static function instance()
    {
        if (is_null(self::$_instance)) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }

    public function init()
    {
        $replace_otp_with = get_option('dig_replace_otp_word', false);
        if (!empty($replace_otp_with)) {
            $this->replaceOTPWith = $replace_otp_with;
            add_filter('gettext_digits', [$this, 'replace_word'], 100, 3);
        }
    }

    public function replace_word($translation, $text, $domain)
    {
        $translation = str_ireplace("OTP", $this->replaceOTPWith, $translation);
        return $translation;
    }

}