Add proper body class for the email editor to mark it a block editor
This class is needed so that some CSS rules (e.g. white background, hidden footer) are applied for WP admin. [MAILPOET-5854]
This commit is contained in:
committed by
Jan Lysý
parent
414e540f33
commit
cc8bb10d8b
@ -69,6 +69,6 @@ class EmailEditor {
|
|||||||
// Enqueue media library scripts
|
// Enqueue media library scripts
|
||||||
$this->wp->wpEnqueueMedia();
|
$this->wp->wpEnqueueMedia();
|
||||||
|
|
||||||
echo '<div id="mailpoet-email-editor"></div>';
|
echo '<div id="mailpoet-email-editor" class="block-editor"></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ class Menu {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// newsletter editor
|
// newsletter editor
|
||||||
$this->wp->addSubmenuPage(
|
$emailEditorPage = $this->wp->addSubmenuPage(
|
||||||
self::EMAILS_PAGE_SLUG,
|
self::EMAILS_PAGE_SLUG,
|
||||||
$this->setPageTitle(__('Email', 'mailpoet')),
|
$this->setPageTitle(__('Email', 'mailpoet')),
|
||||||
esc_html__('Email Editor', 'mailpoet'),
|
esc_html__('Email Editor', 'mailpoet'),
|
||||||
@ -282,6 +282,13 @@ class Menu {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// add body class for form editor page
|
||||||
|
$this->wp->addAction('load-' . $emailEditorPage, function() {
|
||||||
|
$this->wp->addFilter('admin_body_class', function ($classes) {
|
||||||
|
return ltrim($classes . ' block-editor-page');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$this->registerAutomationMenu();
|
$this->registerAutomationMenu();
|
||||||
|
|
||||||
// Forms page
|
// Forms page
|
||||||
|
Reference in New Issue
Block a user