I18N: Make domain argument optional in wp_set_script_translations() / WP_Scripts::set_translations().

Props swissspidy.
Fixes #45489.

git-svn-id: https://develop.svn.wordpress.org/trunk@44395 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2019-01-04 21:11:01 +00:00
parent b9c3486f73
commit 8cf4e9ce6a
4 changed files with 24 additions and 22 deletions
+3 -2
View File
@@ -898,17 +898,18 @@ function load_child_theme_textdomain( $domain, $path = false ) {
*
* @since 5.0.0
* @since 5.0.2 Uses load_script_translations() to load translation data.
* @since 5.1.0 The `$domain` parameter was made optional.
*
* @see WP_Scripts::set_translations()
*
* @param string $handle Name of the script to register a translation domain to.
* @param string $domain The text domain.
* @param string $domain Optional. Text domain. Default 'default'.
* @param string $path Optional. The full file path to the directory containing translation files.
*
* @return false|string False if the script textdomain could not be loaded, the translated strings
* in JSON encoding otherwise.
*/
function load_script_textdomain( $handle, $domain, $path = null ) {
function load_script_textdomain( $handle, $domain = 'default', $path = null ) {
$wp_scripts = wp_scripts();
if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {