Merge pull request #552 from mailpoet/newsletter_listing

Post notification history listing
This commit is contained in:
Tautvidas Sipavičius
2016-07-22 16:20:00 +03:00
committed by GitHub
20 changed files with 533 additions and 228 deletions

View File

@ -32,7 +32,7 @@ class API {
$endpoint = self::ENDPOINT_NAMESPACE . ucfirst($this->endpoint);
if(!$this->api_request) return;
if(!$this->endpoint || !class_exists($endpoint)) {
$this->terminateRequest(self::RESPONSE_ERROR, __('Invalid API endpoint.'));
self::terminateRequest(self::RESPONSE_ERROR, __('Invalid API endpoint.'));
}
$this->callEndpoint(
$endpoint,
@ -43,7 +43,7 @@ class API {
function callEndpoint($endpoint, $action, $data) {
if(!method_exists($endpoint, $action)) {
$this->terminateRequest(self::RESPONSE_ERROR, __('Invalid API action.'));
self::terminateRequest(self::RESPONSE_ERROR, __('Invalid API action.'));
}
call_user_func(
array(
@ -83,7 +83,7 @@ class API {
return add_query_arg($params, home_url());
}
function terminateRequest($code, $message) {
static function terminateRequest($code, $message) {
status_header($code, $message);
exit;
}