diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index aebf3a3b59..649f086d60 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -311,6 +311,12 @@ 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 ); if ( $translations ) { $translations = sprintf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $translations ); @@ -327,7 +333,7 @@ class WP_Scripts extends WP_Dependencies { */ $srce = apply_filters( 'script_loader_src', $src, $handle ); - if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations ) ) { + if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations_stop_concat ) ) { $this->do_concat = false; // Have to print the so-far concatenated scripts right away to maintain the right order. diff --git a/wp-includes/version.php b/wp-includes/version.php index 8e79d23494..2528a4f02f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-RC1-53361'; +$wp_version = '6.0-RC1-53367'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.