Skip to content

Commit 0cd71d3

Browse files
Reduce string literal duplication
Co-authored-by: Weston Ruter <[email protected]>
1 parent 37a6b84 commit 0cd71d3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/class-wp-script-modules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ public function print_script_module_translations(): void {
412412
wp_json_encode( $domain, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
413413
$json_translations
414414
);
415-
$source_url = rawurlencode( "wp-script-module-translation-data-{$id}" );
416-
$output .= "\n//# sourceURL={$source_url}";
417-
wp_print_inline_script_tag( $output, array( 'id' => "wp-script-module-translation-data-{$id}" ) );
415+
$script_id = "wp-script-module-translation-data-{$id}";
416+
$output .= "\n//# sourceURL=" . rawurlencode( $script_id );
417+
wp_print_inline_script_tag( $output, array( 'id' => $script_id ) );
418418
}
419419
}
420420

0 commit comments

Comments
 (0)