Skip to content

Commit

Permalink
ScriptHandler // allow $path to be null for wp_set_script_translation…
Browse files Browse the repository at this point in the history
…s().
  • Loading branch information
Chrico committed Dec 16, 2022
1 parent fddfda6 commit f198d7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Handler/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public function register(Asset $asset): bool

$translation = $asset->translation();
if ($translation['domain'] !== '') {
/**
* The $path is allowed to be "null"- or a "string"-value.
* @psalm-suppress PossiblyNullArgument
*/
wp_set_script_translations($handle, $translation['domain'], $translation['path']);
}

Expand Down

0 comments on commit f198d7d

Please sign in to comment.