From 0411ed2c372a738fdb08a7085634b463de1c11f4 Mon Sep 17 00:00:00 2001 From: Jan Jakes Date: Mon, 2 Oct 2023 14:38:00 +0200 Subject: [PATCH] Enqueue Parsley translation strings in after "admin_vendor" This is a better place and it corresponds to the current logic. [MAILPOET-5118] --- mailpoet/lib/AdminPages/AssetsController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mailpoet/lib/AdminPages/AssetsController.php b/mailpoet/lib/AdminPages/AssetsController.php index a9b4b4d7c5..67572c0517 100644 --- a/mailpoet/lib/AdminPages/AssetsController.php +++ b/mailpoet/lib/AdminPages/AssetsController.php @@ -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) {