WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/04/2019 09:11:01 PM (21 months ago)
Author:
ocean90
Message:

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

Props swissspidy.
Fixes #45489.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n.php

    r44318 r44395  
    899899 * @since 5.0.0
    900900 * @since 5.0.2 Uses load_script_translations() to load translation data.
     901 * @since 5.1.0 The `$domain` parameter was made optional.
    901902 *
    902903 * @see WP_Scripts::set_translations()
    903904 *
    904905 * @param string $handle Name of the script to register a translation domain to.
    905  * @param string $domain The text domain.
     906 * @param string $domain Optional. Text domain. Default 'default'.
    906907 * @param string $path   Optional. The full file path to the directory containing translation files.
    907908 *
     
    909910 *                      in JSON encoding otherwise.
    910911 */
    911 function load_script_textdomain( $handle, $domain, $path = null ) {
     912function load_script_textdomain( $handle, $domain = 'default', $path = null ) {
    912913    $wp_scripts = wp_scripts();
    913914
Note: See TracChangeset for help on using the changeset viewer.