Used By
| Used By | Description |
|---|---|
| wp-includes/functions.wp-scripts.php: wp_set_script_translations() | Sets translated strings for a script. |
Sets a translation textdomain.
(string) (Required) Name of the script to register a translation domain to.
(string) (Optional) Text domain.
Default value: 'default'
(string) (Optional) The full file path to the directory containing translation files.
Default value: null
(bool) True if the text domain was registered, false if not.
File: wp-includes/class.wp-scripts.php
public function set_translations( $handle, $domain = 'default', $path = null ) {
if ( ! isset( $this->registered[ $handle ] ) ) {
return false;
}
/** @var \_WP_Dependency $obj */
$obj = $this->registered[ $handle ];
if ( ! in_array( 'wp-i18n', $obj->deps, true ) ) {
$obj->deps[] = 'wp-i18n';
}
return $obj->set_translations( $domain, $path );
} | Version | Description |
|---|---|
| 5.1.0 | The $domain parameter was made optional. |
| 5.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_scripts/set_translations