From f1df51b997bfe35189254b09dd7b436e608b88b5 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Thu, 14 Apr 2022 10:31:43 +0300 Subject: [PATCH] Allow using a domainpath --- lib/compat/wordpress-6.0/blocks.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/compat/wordpress-6.0/blocks.php b/lib/compat/wordpress-6.0/blocks.php index 06ad86207b7ed..89769623f0bb2 100644 --- a/lib/compat/wordpress-6.0/blocks.php +++ b/lib/compat/wordpress-6.0/blocks.php @@ -198,8 +198,9 @@ 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' => '', + 'domainpath' => null, ) ); @@ -228,7 +229,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;