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:
@ -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);
|
||||
|
Reference in New Issue
Block a user