Display notice only on specified listings pages

[MAILPOET-2643]
This commit is contained in:
Pavel Dohnal
2020-04-06 16:05:34 +02:00
committed by Veljko V
parent a8ebd88294
commit f6c602d474

View File

@@ -554,8 +554,15 @@ class Menu {
public function checkMailPoetAPIKey(ServicesChecker $checker = null) {
if (self::isOnMailPoetAdminPage()) {
$showNotices = isset($_REQUEST['page'])
&& (
stripos($_REQUEST['page'], self::MAIN_PAGE_SLUG) !== false
|| stripos($_REQUEST['page'], 'mailpoet-segments') !== false
|| stripos($_REQUEST['page'], 'mailpoet-subscribers') !== false
);
$checker = $checker ?: $this->servicesChecker;
$this->mpApiKeyValid = $checker->isMailPoetAPIKeyValid();
$checker = $checker ?: $this->servicesChecker;
$this->mpApiKeyValid = $checker->isMailPoetAPIKeyValid($showNotices);
}
}