From fe6013f0cf93b027e2383c28b705f81aa62fcaea Mon Sep 17 00:00:00 2001 From: Sam Najian Date: Wed, 15 Jun 2022 10:15:52 +0200 Subject: [PATCH] Fix the issue of marketing optin block translation not getting added Since WP 6.0 we can no longer leave translation_path in block settings empty and expect to receive the fallback thus we need to add the fallback ourselves. [MAILPOET-4435] --- .../lib/PostEditorBlocks/MarketingOptinBlock.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mailpoet/lib/PostEditorBlocks/MarketingOptinBlock.php b/mailpoet/lib/PostEditorBlocks/MarketingOptinBlock.php index c5ab188db0..044dcf06e7 100644 --- a/mailpoet/lib/PostEditorBlocks/MarketingOptinBlock.php +++ b/mailpoet/lib/PostEditorBlocks/MarketingOptinBlock.php @@ -86,11 +86,14 @@ class MarketingOptinBlock implements IntegrationInterface { */ private function registerEditorTranslations() { $handle = 'mailpoet-marketing-optin-block-editor-script'; - $editorTranslations = $this->wp->getWpScripts()->print_translations($handle, false); - // mailpoet-marketing-optin-block-editor-script is not enqueued - if ($editorTranslations === false) { - return; - } + $editorTranslations = << ['domain' => 'messages'], 'marketing-opt-in-label' => [__('Marketing opt-in', 'mailpoet')],