From 24e2829eb95e2fdb31c5774b510d0b39cee13034 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Mon, 11 Mar 2019 20:32:52 +0000 Subject: [PATCH] I18N: Add `$domain` argument to `translate_user_role()`. The text domain is optional and gets passed to `translate_with_gettext_context()`. Props johnjamesjacoby . Fixes #38736. Built from https://develop.svn.wordpress.org/trunk@44830 git-svn-id: http://core.svn.wordpress.org/trunk@44662 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n.php | 9 ++++++--- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 39aa6d498e..d6904ab2d9 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -1232,12 +1232,15 @@ function is_textdomain_loaded( $domain ) { * won't suffer from that problem. * * @since 2.8.0 + * @since 5.2.0 Added the `$domain` parameter. * - * @param string $name The role name. + * @param string $name The role name. + * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings. + * Default 'default'. * @return string Translated role name on success, original name on failure. */ -function translate_user_role( $name ) { - return translate_with_gettext_context( before_last_bar( $name ), 'User role' ); +function translate_user_role( $name, $domain = 'default' ) { + return translate_with_gettext_context( before_last_bar( $name ), 'User role', $domain ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 57757e19e3..ce4b04b1d9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-44829'; +$wp_version = '5.2-alpha-44830'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.