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:
David Remer
2022-08-04 12:54:09 +03:00
committed by Veljko V
parent 0b2b211b08
commit b05e6d414c
156 changed files with 645 additions and 719 deletions

View File

@ -3,7 +3,6 @@
namespace MailPoet\API\JSON;
use MailPoet\Config\AccessControl;
use MailPoet\WP\Functions as WPFunctions;
abstract class Endpoint {
const TYPE_POST = 'POST';
@ -27,7 +26,7 @@ abstract class Endpoint {
) {
if (empty($errors)) {
$errors = [
Error::UNKNOWN => WPFunctions::get()->__('An unknown error occurred.', 'mailpoet'),
Error::UNKNOWN => __('An unknown error occurred.', 'mailpoet'),
];
}
return new ErrorResponse($errors, $meta, $status);
@ -36,7 +35,7 @@ abstract class Endpoint {
public function badRequest($errors = [], $meta = []) {
if (empty($errors)) {
$errors = [
Error::BAD_REQUEST => WPFunctions::get()->__('Invalid request parameters', 'mailpoet'),
Error::BAD_REQUEST => __('Invalid request parameters', 'mailpoet'),
];
}
return new ErrorResponse($errors, $meta, Response::STATUS_BAD_REQUEST);