From e6442466f959e4cb419b0fdfa14aec0fcae2038f Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Mon, 11 Mar 2019 20:31:46 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@44830 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/l10n.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/l10n.php b/src/wp-includes/l10n.php index 39aa6d498e..d6904ab2d9 100644 --- a/src/wp-includes/l10n.php +++ b/src/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 ); } /**