Remove WP\Functions::__ and other translate functions
Under the new sniffer rules, those functions produce errors and, when those methods are used, the sniffer can not properly be applied. [MAILPOET-4524]
This commit is contained in:
@ -119,7 +119,7 @@ class Settings extends APIEndpoint {
|
||||
return $this->badRequest(
|
||||
[
|
||||
APIError::BAD_REQUEST =>
|
||||
WPFunctions::get()->__('You have not specified any settings to be saved.', 'mailpoet'),
|
||||
__('You have not specified any settings to be saved.', 'mailpoet'),
|
||||
]);
|
||||
} else {
|
||||
$oldSettings = $this->settings->getAll();
|
||||
@ -178,7 +178,7 @@ class Settings extends APIEndpoint {
|
||||
$address = $data['address'] ?? null;
|
||||
if (!$address) {
|
||||
return $this->badRequest([
|
||||
APIError::BAD_REQUEST => WPFunctions::get()->__('No email address specified.', 'mailpoet'),
|
||||
APIError::BAD_REQUEST => __('No email address specified.', 'mailpoet'),
|
||||
]);
|
||||
}
|
||||
$address = trim($address);
|
||||
@ -187,7 +187,7 @@ class Settings extends APIEndpoint {
|
||||
$this->authorizedEmailsController->setFromEmailAddress($address);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return $this->badRequest([
|
||||
APIError::UNAUTHORIZED => WPFunctions::get()->__('Can’t use this email yet! Please authorize it first.', 'mailpoet'),
|
||||
APIError::UNAUTHORIZED => __('Can’t use this email yet! Please authorize it first.', 'mailpoet'),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ class Settings extends APIEndpoint {
|
||||
|
||||
if (!$emailAddress) {
|
||||
return $this->badRequest([
|
||||
APIError::BAD_REQUEST => WPFunctions::get()->__('No email address specified.', 'mailpoet'),
|
||||
APIError::BAD_REQUEST => __('No email address specified.', 'mailpoet'),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ class Settings extends APIEndpoint {
|
||||
$response = ['status' => true];
|
||||
} else {
|
||||
return $this->badRequest([
|
||||
APIError::BAD_REQUEST => WPFunctions::get()->__($e->getMessage(), 'mailpoet'),
|
||||
APIError::BAD_REQUEST => __($e->getMessage(), 'mailpoet'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -235,7 +235,7 @@ class Settings extends APIEndpoint {
|
||||
|
||||
if (!$emailAddress) {
|
||||
return $this->badRequest([
|
||||
APIError::BAD_REQUEST => WPFunctions::get()->__('No email address specified.', 'mailpoet'),
|
||||
APIError::BAD_REQUEST => __('No email address specified.', 'mailpoet'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user