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/class.wp-scripts.php

    r44239 r44395  
    500500     *
    501501     * @since 5.0.0
     502     * @since 5.1.0 The `$domain` parameter was made optional.
    502503     *
    503504     * @param string $handle Name of the script to register a translation domain to.
    504      * @param string $domain The textdomain.
     505     * @param string $domain Optional. Text domain. Default 'default'.
    505506     * @param string $path   Optional. The full file path to the directory containing translation files.
    506      *
    507      * @return bool True if the textdomain was registered, false if not.
    508      */
    509     public function set_translations( $handle, $domain, $path = null ) {
     507     * @return bool True if the text domain was registered, false if not.
     508     */
     509    public function set_translations( $handle, $domain = 'default', $path = null ) {
    510510        if ( ! isset( $this->registered[ $handle ] ) ) {
    511511            return false;
     
    518518            $obj->deps[] = 'wp-i18n';
    519519        }
     520
    520521        return $obj->set_translations( $domain, $path );
    521522    }
Note: See TracChangeset for help on using the changeset viewer.