mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 19:24:34 +00:00
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:
@@ -209,14 +209,14 @@ function wp_localize_script( $handle, $object_name, $l10n ) {
|
||||
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
|
||||
*
|
||||
* @since 5.0.0
|
||||
* @since 5.1.0 The `$domain` parameter was made optional.
|
||||
*
|
||||
* @param string $handle Script handle the textdomain will be attached to.
|
||||
* @param string $domain The textdomain.
|
||||
* @param string $domain Optional. Text domain. Default 'default'.
|
||||
* @param string $path Optional. The full file path to the directory containing translation files.
|
||||
*
|
||||
* @return bool True if the textdomain was successfully localized, false otherwise.
|
||||
* @return bool True if the text domain was successfully localized, false otherwise.
|
||||
*/
|
||||
function wp_set_script_translations( $handle, $domain, $path = null ) {
|
||||
function wp_set_script_translations( $handle, $domain = 'default', $path = null ) {
|
||||
global $wp_scripts;
|
||||
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
|
||||
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
|
||||
|
||||
Reference in New Issue
Block a user