Hide Automations menu for bundles

Using null instead of true so that the pages are available directly.

[MAILPOET-5223]
This commit is contained in:
Brezo Cordero
2023-05-09 18:35:03 -05:00
committed by Aschepikov
parent c5bc51fc86
commit 6b40dfabf3
2 changed files with 55 additions and 1 deletions

View File

@ -482,8 +482,14 @@ class Menu {
}
private function registerAutomationMenu(bool $showEntries) {
$parentSlug = self::MAIN_PAGE_SLUG;
// Automations menu is hidden when the subscription is part of a bundle and AutomateWoo is active but pages can be accessed directly
if ($this->wp->isPluginActive('automatewoo/automatewoo.php') && $this->servicesChecker->isBundledSubscription()) {
$parentSlug = null;
}
$automationPage = $this->wp->addSubmenuPage(
$showEntries ? self::MAIN_PAGE_SLUG : true,
$showEntries ? $parentSlug : true,
$this->setPageTitle(__('Automations', 'mailpoet')),
// @ToDo Remove Beta once Automation is no longer beta.
'<span>' . esc_html__('Automations', 'mailpoet') . '</span><span class="mailpoet-beta-badge">Beta</span>',
@ -503,6 +509,7 @@ class Menu {
);
// Automation templates
$this->wp->addSubmenuPage(
true,
$this->setPageTitle(__('Automation Templates', 'mailpoet')),