Enqueue Parsley translation strings in after "admin_vendor"
This is a better place and it corresponds to the current logic. [MAILPOET-5118]
This commit is contained in:
@@ -84,9 +84,6 @@ class AssetsController {
|
||||
true
|
||||
);
|
||||
$this->wp->wpSetScriptTranslations($name, 'mailpoet');
|
||||
|
||||
// append Parsley validation string translations
|
||||
$this->wp->wpAddInlineScript($name, $this->renderer->render('parsley-translations.html'));
|
||||
}
|
||||
|
||||
private function registerAdminDeps(): void {
|
||||
@@ -117,6 +114,9 @@ class AssetsController {
|
||||
]
|
||||
);
|
||||
|
||||
// append Parsley validation string translations
|
||||
$this->wp->wpAddInlineScript('mailpoet_admin_vendor', $this->renderer->render('parsley-translations.html'));
|
||||
|
||||
// enqueue "mailpoet_admin_vendor" so the hook fires after it, but before "mailpoet_admin"
|
||||
$this->wp->wpEnqueueScript('mailpoet_admin_vendor');
|
||||
if ($this->wp->didAction('mailpoet_scripts_admin_before') === 0) {
|
||||
|
Reference in New Issue
Block a user