diff --git a/lib/compat/wordpress-6.1/blocks.php b/lib/compat/wordpress-6.1/blocks.php index dbfd4f49b7373..85e124306161a 100644 --- a/lib/compat/wordpress-6.1/blocks.php +++ b/lib/compat/wordpress-6.1/blocks.php @@ -79,7 +79,7 @@ function wp_enqueue_block_view_script( $block_name, $args ) { 'ver' => false, 'in_footer' => false, - // Additional arg to allow translations for the script's textdomain. + // Additional args to allow translations for the script's textdomain. 'textdomain' => '', ) ); @@ -109,7 +109,7 @@ function wp_enqueue_block_view_script( $block_name, $args ) { // If a textdomain is defined, use it to set the script translations. if ( ! empty( $args['textdomain'] ) && in_array( 'wp-i18n', $args['deps'], true ) ) { - wp_set_script_translations( $args['handle'], $args['textdomain'] ); + wp_set_script_translations( $args['handle'], $args['textdomain'], $args['domainpath'] ); } return $content;