From d8ef0cd52e53cb01c34749d68ca55c48c3e8526d Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sun, 8 May 2022 23:57:19 +0000 Subject: [PATCH] Script Loader: Explain why i18n prevents concatenation. Add inline comment to `WP_Scripts::do_item()` explaining why the definition of a text domain prevents concatenation. Follow up to [53360]. Fixes #55628. Props SergeyBiryukov. git-svn-id: https://develop.svn.wordpress.org/trunk@53366 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class.wp-scripts.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-includes/class.wp-scripts.php b/src/wp-includes/class.wp-scripts.php index 246d1fe6a2..649f086d60 100644 --- a/src/wp-includes/class.wp-scripts.php +++ b/src/wp-includes/class.wp-scripts.php @@ -311,6 +311,10 @@ class WP_Scripts extends WP_Dependencies { $inline_script_tag = ''; } + /* + * Prevent concatenation of scripts if the text domain is defined + * to ensure the dependency order is respected. + */ $translations_stop_concat = ! empty( $obj->textdomain ); $translations = $this->print_translations( $handle, false );