Replace all WP function calls

This commit is contained in:
Amine Ben hammou
2019-02-20 18:56:48 +01:00
committed by M. Shull
parent 986482e34b
commit 0a436087e1
176 changed files with 1066 additions and 803 deletions

View File

@ -3,6 +3,7 @@
namespace MailPoet\API\JSON;
use MailPoet\Config\AccessControl;
use MailPoet\WP\Functions as WPFunctions;
if (!defined('ABSPATH')) exit;
@ -23,7 +24,7 @@ abstract class Endpoint {
) {
if (empty($errors)) {
$errors = array(
Error::UNKNOWN => __('An unknown error occurred.', 'mailpoet')
Error::UNKNOWN => WPFunctions::get()->__('An unknown error occurred.', 'mailpoet')
);
}
return new ErrorResponse($errors, $meta, $status);
@ -32,7 +33,7 @@ abstract class Endpoint {
function badRequest($errors = array(), $meta = array()) {
if (empty($errors)) {
$errors = array(
Error::BAD_REQUEST => __('Invalid request parameters', 'mailpoet')
Error::BAD_REQUEST => WPFunctions::get()->__('Invalid request parameters', 'mailpoet')
);
}
return new ErrorResponse($errors, $meta, Response::STATUS_BAD_REQUEST);