Skip to content

Commit 05c6016

Browse files
Use ES6 and PHP 7.4 syntax
Co-authored-by: Weston Ruter <westonruter@gmail.com>
1 parent 1a0d9ca commit 05c6016

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
@@ -394,12 +394,12 @@ public function print_script_module_translations(): void {
394394
}
395395

396396
$output = <<<JS
397-
( function( domain, translations ) {
398-
var localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
397+
( ( domain, translations ) => {
398+
const localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
399399
localeData[""].domain = domain;
400400
wp.i18n.setLocaleData( localeData, domain );
401401
} )( "{$domain}", {$json_translations} );
402-
JS;
402+
JS;
403403

404404
$source_url = rawurlencode( "{$id}-js-module-translations" );
405405
$output .= "\n//# sourceURL={$source_url}";

0 commit comments

Comments
 (0)