wp_set_script_translations

SummerySummery

Sets translated strings for a script.

Syntax

wp_set_script_translations( string $handle, string $domain = 'default', string $path = null )

DescriptionDescription

Works only if the script has already been added.

ParametersParameters

$handle

(string) (Required) Script handle the textdomain will be attached to.

$domain

(string) (Optional) Text domain.

Default value: 'default'

$path

(string) (Optional) The full file path to the directory containing translation files.

Default value: null

ReturnReturn

(bool) True if the text domain was successfully localized, false otherwise.

SourceSource

File: wp-includes/functions.wp-scripts.php


			

ChangelogChangelog

Changelog
Version Description
5.1.0 The $domain parameter was made optional.
5.0.0 Introduced.

See alsoSee also

Scroll to Top