Add newsletter_editor.js using AssetsController
newsletter_editor.js was added via newsletter/editor.html it's now removed from the template and wpEnqueueScript is user instead [MAILPOET-4908]
This commit is contained in:
@@ -160,4 +160,22 @@ EOL;
|
||||
);
|
||||
$this->wp->wpSetScriptTranslations('automation_templates', 'mailpoet');
|
||||
}
|
||||
|
||||
public function setupNewsletterEditorDependencies(): void {
|
||||
|
||||
$this->wp->wpEnqueueScript(
|
||||
'newsletter_editor',
|
||||
Env::$assetsUrl . '/dist/js/' . $this->renderer->getJsAsset('newsletter_editor.js'),
|
||||
[],
|
||||
Env::$version,
|
||||
true
|
||||
);
|
||||
|
||||
/**
|
||||
* The js file needs to be added immediately since the mailpoet_newsletters_editor_initialize hook is dispatched in template files
|
||||
* Update and remove this line in MAILPOET-4930
|
||||
*/
|
||||
\wp_scripts()->do_item('newsletter_editor');
|
||||
$this->wp->wpDequeueScript('newsletter_editor');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user