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
@ -270,7 +270,7 @@ class Menu {
|
||||
);
|
||||
|
||||
// newsletter editor
|
||||
$this->wp->addSubmenuPage(
|
||||
$emailEditorPage = $this->wp->addSubmenuPage(
|
||||
self::EMAILS_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Email', '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();
|
||||
|
||||
// Forms page
|
||||
|
Reference in New Issue
Block a user