Refactor initialization of the email editor

This changes how the editor is initialized. The integration initialization class
doesn't get the engine class anymore, but integration is initialized via
mailpoet_email_editor_initialized action triggered from the engine.

This allows multiple integrations to hook into the engine.
[MAILPOET-5540]
This commit is contained in:
Rostislav Wolny
2023-08-22 16:45:57 +02:00
committed by Jan Lysý
parent 2517023ad0
commit b70ad064c7
4 changed files with 15 additions and 9 deletions

View File

@@ -27,6 +27,7 @@ class EmailEditorTest extends \MailPoetTest {
public function testItRegistersMailPoetEmailPostType() {
$this->emailEditor->initialize();
$this->diContainer->get(\MailPoet\EmailEditor\Engine\EmailEditor::class)->initialize();
$postTypes = get_post_types();
$this->assertArrayHasKey('mailpoet_email', $postTypes);
}