Make WordPress Core


Ignore:
Timestamp:
01/04/2019 09:11:01 PM (7 years 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/functions.wp-scripts.php

    r44350 r44395  
    210210 *
    211211 * @since 5.0.0
     212 * @since 5.1.0 The `$domain` parameter was made optional.
    212213 *
    213214 * @param string $handle Script handle the textdomain will be attached to.
    214  * @param string $domain The textdomain.
     215 * @param string $domain Optional. Text domain. Default 'default'.
    215216 * @param string $path   Optional. The full file path to the directory containing translation files.
    216  *
    217  * @return bool True if the textdomain was successfully localized, false otherwise.
    218  */
    219 function wp_set_script_translations( $handle, $domain, $path = null ) {
     217 * @return bool True if the text domain was successfully localized, false otherwise.
     218 */
     219function wp_set_script_translations( $handle, $domain = 'default', $path = null ) {
    220220    global $wp_scripts;
    221221    if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
Note: See TracChangeset for help on using the changeset viewer.