PHPMailer\PHPMailer

PHPMailer::langprotected staticWP 1.0

Get an error message in the current language.

Метод класса: PHPMailer{}

Хуков нет.

Возвращает

Строку.

Использование

$result = PHPMailer::lang( $key );
$key(строка) (обязательный)
.

Код PHPMailer::lang() WP 6.9

protected static function lang($key)
{
    if (count(self::$language) < 1) {
        self::setLanguage(); //Set the default language
    }

    if (array_key_exists($key, self::$language)) {
        if ('smtp_connect_failed' === $key) {
            //Include a link to troubleshooting docs on SMTP connection failure.
            //This is by far the biggest cause of support questions
            //but it's usually not PHPMailer's fault.
            return self::$language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
        }

        return self::$language[$key];
    }

    //Return the key as a fallback
    return $key;
}