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:
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace MailPoet\API\JSON;
|
||||
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class ErrorResponse extends Response {
|
||||
public $errors;
|
||||
|
||||
@@ -24,7 +22,7 @@ class ErrorResponse extends Response {
|
||||
return array_map(function($error, $message) {
|
||||
// sanitize SQL error
|
||||
if (preg_match('/^SQLSTATE/i', $message)) {
|
||||
$message = WPFunctions::get()->__('An unknown error occurred.', 'mailpoet');
|
||||
$message = __('An unknown error occurred.', 'mailpoet');
|
||||
}
|
||||
return [
|
||||
'error' => $error,
|
||||
|
Reference in New Issue
Block a user